Skip to content

Commit

Permalink
fix issue Yggdroot#453
Browse files Browse the repository at this point in the history
Navigate within result window is slow
  • Loading branch information
Yggdroot committed Jan 3, 2020
1 parent 001aacf commit 614a2fe
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions autoload/leaderf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,13 @@ function! leaderf#NormalModeFilter(id, winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value._cli._buildPopupPrompt()", a:id)
redraw
"redraw
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value._getInstance().refreshPopupStatusline()", a:id)
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value._previewResult(False)", a:id)
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value._cli._buildPopupPrompt()", a:id)
redraw
"redraw
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value._getInstance().refreshPopupStatusline()", a:id)
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value._previewResult(False)", a:id)
elseif key ==? "<PageUp>" || key ==? "<C-B>"
Expand Down
4 changes: 2 additions & 2 deletions autoload/leaderf/Buffer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ function! leaderf#Buffer#NormalModeFilter(winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py "bufExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "bufExplManager._getInstance().refreshPopupStatusline()"
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py "bufExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "bufExplManager._getInstance().refreshPopupStatusline()"
elseif key ==? "<PageUp>" || key ==? "<C-B>"
call win_execute(a:winid, "norm! \<PageUp>")
Expand Down
4 changes: 2 additions & 2 deletions autoload/leaderf/Command.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ function! leaderf#Command#NormalModeFilter(winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py "commandExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "commandExplManager._getInstance().refreshPopupStatusline()"
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py "commandExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "commandExplManager._getInstance().refreshPopupStatusline()"
elseif key ==? "<PageUp>" || key ==? "<C-B>"
call win_execute(a:winid, "norm! \<PageUp>")
Expand Down
4 changes: 2 additions & 2 deletions autoload/leaderf/File.vim
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ function! leaderf#File#NormalModeFilter(winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py "fileExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "fileExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "fileExplManager._previewResult(False)"
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py "fileExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "fileExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "fileExplManager._previewResult(False)"
elseif key ==? "<PageUp>" || key ==? "<C-B>"
Expand Down
4 changes: 2 additions & 2 deletions autoload/leaderf/Gtags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ function! leaderf#Gtags#NormalModeFilter(winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py "gtagsExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "gtagsExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "gtagsExplManager._previewResult(False)"
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py "gtagsExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "gtagsExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "gtagsExplManager._previewResult(False)"
elseif key ==? "<PageUp>" || key ==? "<C-B>"
Expand Down
4 changes: 2 additions & 2 deletions autoload/leaderf/History.vim
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ function! leaderf#History#NormalModeFilter(winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py "historyExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "historyExplManager._getInstance().refreshPopupStatusline()"
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py "historyExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "historyExplManager._getInstance().refreshPopupStatusline()"
elseif key ==? "<PageUp>" || key ==? "<C-B>"
call win_execute(a:winid, "norm! \<PageUp>")
Expand Down
4 changes: 2 additions & 2 deletions autoload/leaderf/Mru.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ function! leaderf#Mru#NormalModeFilter(winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py "mruExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "mruExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "mruExplManager._previewResult(False)"
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py "mruExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "mruExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "mruExplManager._previewResult(False)"
elseif key ==? "<PageUp>" || key ==? "<C-B>"
Expand Down
4 changes: 2 additions & 2 deletions autoload/leaderf/Rg.vim
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ function! leaderf#Rg#NormalModeFilter(winid, key) abort
if key ==# "j" || key ==? "<Down>"
call win_execute(a:winid, "norm! j")
exec g:Lf_py "rgExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "rgExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "rgExplManager._previewResult(False)"
elseif key ==# "k" || key ==? "<Up>"
call win_execute(a:winid, "norm! k")
exec g:Lf_py "rgExplManager._cli._buildPopupPrompt()"
redraw
"redraw
exec g:Lf_py "rgExplManager._getInstance().refreshPopupStatusline()"
exec g:Lf_py "rgExplManager._previewResult(False)"
elseif key ==? "<PageUp>" || key ==? "<C-B>"
Expand Down
8 changes: 4 additions & 4 deletions autoload/leaderf/python/leaderf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ def _buildPopupPrompt(self):
if spin != "":
lfCmd("""call win_execute(%d, "call prop_add(1, %d, {'length': %d, 'type': 'Lf_hl_popup_spin'})")"""
% (input_window.id, lfBytesLen(text[:spin_start]) + 1, lfBytesLen(spin)))

lfCmd("redraw")
else:
input_window.buffer[0] = text

Expand Down Expand Up @@ -312,7 +310,9 @@ def _buildPopupPrompt(self):
% (input_window.buffer.number, self._input_buf_namespace,
lfBytesLen(text[:spin_start]), lfBytesLen(text[:spin_start]) + lfBytesLen(spin)))

lfCmd("redraw")
def buildPopupPrompt(self):
self._buildPopupPrompt()
lfCmd("redraw")

def _buildPrompt(self):
if lfEval("has('nvim')") == '1' and self._instance.getWinPos() != 'floatwin':
Expand All @@ -337,7 +337,7 @@ def _buildPrompt(self):
return

if self._instance.getWinPos() in ('popup', 'floatwin'):
self._buildPopupPrompt()
self.buildPopupPrompt()
return

if self._is_fuzzy:
Expand Down
2 changes: 1 addition & 1 deletion autoload/leaderf/python/leaderf/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def setStlResultsCount(self, count, check_ignored=False):
lfCmd("redrawstatus")

if self._win_pos in ('popup', 'floatwin'):
self._cli._buildPopupPrompt()
self._cli.buildPopupPrompt()

def setStlRunning(self, running):
if self._win_pos in ('popup', 'floatwin'):
Expand Down
8 changes: 4 additions & 4 deletions autoload/leaderf/python/leaderf/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def _closePreviewPopup(self):

def _previewResult(self, preview):
if self._getInstance().getWinPos() == 'floatwin':
self._cli._buildPopupPrompt()
self._cli.buildPopupPrompt()

if int(lfEval("win_id2win(%d)" % self._preview_winid)) != vim.current.window.number:
self._closePreviewPopup()
Expand Down Expand Up @@ -1635,7 +1635,7 @@ def accept(self, mode=''):
lfCmd("norm! j")

if self._getInstance().getWinPos() in ('popup', 'floatwin'):
self._cli._buildPopupPrompt()
self._cli.buildPopupPrompt()

return

Expand Down Expand Up @@ -2259,7 +2259,7 @@ def input(self):
self._current_mode = 'INPUT'
self._getInstance().hideMimicCursor()
if self._getInstance().getWinPos() in ('popup', 'floatwin'):
self._cli._buildPopupPrompt()
self._cli.buildPopupPrompt()
lfCmd("call leaderf#colorscheme#popup#hiMode('%s', '%s')" % (self._getExplorer().getStlCategory(), self._current_mode))
self._getInstance().setPopupStl(self._current_mode)

Expand Down Expand Up @@ -2374,7 +2374,7 @@ def input(self):
self._highlight_method()

if self._getInstance().getWinPos() in ('popup', 'floatwin'):
self._cli._buildPopupPrompt()
self._cli.buildPopupPrompt()
lfCmd("call leaderf#colorscheme#popup#hiMode('%s', '%s')" % (self._getExplorer().getStlCategory(), self._current_mode))
self._getInstance().setPopupStl(self._current_mode)

Expand Down

0 comments on commit 614a2fe

Please sign in to comment.