Skip to content

Commit 58a7cd2

Browse files
committed
feat: separate deco/mark and subs draws
1 parent 4ca4d30 commit 58a7cd2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/ui/editor/draw.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,15 +429,16 @@ export function Draw({ paneInfo, view, selection, caret, dims, buffer, colorize
429429
drawClear()
430430
drawActiveLine()
431431
drawSelection()
432-
widgets.draw()
432+
widgets.drawDecoMark()
433433
drawCode()
434+
widgets.drawSubs()
434435
drawCaret()
435436
c.restore()
436437
drawScrollbars()
437438
info.shouldRedraw = false
438439
}
439440
else {
440-
widgets.draw()
441+
widgets.drawDecoMark()
441442
}
442443
}
443444

src/ui/editor/widget.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,18 @@ export function Widgets({ c }: {
4848
})
4949
}
5050

51-
function draw() {
51+
function drawDecoMark() {
5252
update()
5353
deco.forEach(widgetDraw)
54-
subs.forEach(widgetDraw)
5554
mark.forEach(widgetDraw)
5655
}
5756

58-
const widgets = { update, draw, deco, subs, mark, heights, lines }
57+
function drawSubs() {
58+
update()
59+
subs.forEach(widgetDraw)
60+
}
61+
62+
const widgets = { update, drawDecoMark, drawSubs, deco, subs, mark, heights, lines }
5963

6064
return widgets
6165
}

0 commit comments

Comments
 (0)