Skip to content

Commit

Permalink
Restore cursor position
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed May 2, 2019
1 parent c549c83 commit 1de25c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rplugin/python3/denite/ui/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self, vim):
self._selected_candidates = []
self._candidates = []
self._candidates_len = 0
self._cursor = 0
self._entire_len = 0
self._result = []
self._context = {}
Expand Down Expand Up @@ -97,6 +98,7 @@ def _start(self, sources, context):
self.init_buffer()
if context['refresh']:
self.redraw()
self.move_to_pos(self._cursor)
else:
self._context.clear()
self._context.update(context)
Expand Down Expand Up @@ -482,6 +484,7 @@ def do_command(self, command):
self.quit_buffer()

def cleanup(self):
self._cursor = self._vim.call('line', '.')
# Clear previewed buffers
if not self._context['has_preview_window']:
self._vim.command('pclose!')
Expand Down

0 comments on commit 1de25c3

Please sign in to comment.