From 9d8a4a1f0397db5def1aac57c7dac67fd7ed4ada Mon Sep 17 00:00:00 2001 From: John Novak Date: Sat, 23 Mar 2024 15:26:21 +1000 Subject: [PATCH] Note list fixes --- src/main.nim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.nim b/src/main.nim index 95db8c70..bfdda9a3 100644 --- a/src/main.nim +++ b/src/main.nim @@ -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 @@ -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) @@ -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)