Skip to content

Commit

Permalink
Note list fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnovak committed Mar 23, 2024
1 parent 7e31210 commit 9d8a4a1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8241,8 +8241,8 @@ proc renderNotesListPane(x, y, w, h: float; a) =
)

func sortByTextLocationType(a, b: NotesListCacheEntry): int =
let noteA = l.getNote(a.row, b.col).get
let noteB = l.getNote(a.row, b.col).get
let noteA = l.getNote(a.row, a.col).get
let noteB = l.getNote(b.row, b.col).get
var c = sortByTextAndLocation((a.row, a.col), noteA,
(b.row, b.col), noteB)
if c != 0: return c
Expand Down Expand Up @@ -8273,6 +8273,7 @@ proc renderNotesListPane(x, y, w, h: float; a) =
lp.rowPad = 0
lp.labelWidth = w
lp.leftPad = 0
lp.sectionPad = 0

initAutoLayout(lp)

Expand All @@ -8282,8 +8283,11 @@ proc renderNotesListPane(x, y, w, h: float; a) =
for e in nls.cache:
let note = l.getNote(e.row, e.col).get

koi.nextRowHeight(e.height)
koi.nextItemHeight(e.height)
const MinHeight = 32
let height = max(MinHeight, e.height)

koi.nextRowHeight(height)
koi.nextItemHeight(height)

if noteButton(e.id, textX, textY=17, textW, markerX, note):
moveCursorTo(Location(level: ui.cursor.level, row: e.row, col: e.col), a)
Expand Down

0 comments on commit 9d8a4a1

Please sign in to comment.