Shougo / ddu.vim

Dark deno-powered UI framework for Vim/NeoVim
MIT License
295 stars 24 forks source link

Fast redraw #72

Closed Milly closed 1 year ago

Milly commented 1 year ago

When sync options is disabled, Ddu.redraw() may be called too many times. Also waiting for redraw to complete before processing the next gather chunk.

This PR runs redraw asynchronously and scheduled.

Example of execution timing:

# Previous
Gather chunk :             [-A-]          [-B-]          [-C-]
Redraw       : [redraw Pre]     [redraw A]     [redraw B]     [redraw C]

# This PR
Gather chunk :      [-A-][-B-][-C-]
Redraw       : [redraw Pre][redraw A][redraw C]

# This PR also fine with multiple sources
Source 1 :      [-A-][-B-][-C-]
Source 2 :       [---D---][---E---]
Source 3 :        [----F----]
Redraw   : [redraw Pre][redraw A][redraw C][redraw E]

And uiRedrawLock has been renamed to avoid confusion.