Skip to content

Commit

Permalink
fix issue #257
Browse files Browse the repository at this point in the history
  • Loading branch information
Yggdroot committed Dec 22, 2018
1 parent 5ca9748 commit bc55aee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions autoload/leaderf/python/leaderf/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,13 @@ def accept(self, mode=''):

self._cli.writeHistory(self._getExplorer().getStlCategory())

# https:/neovim/neovim/issues/8336
if lfEval("has('nvim')") == '1':
chdir = vim.chdir
else:
chdir = os.chdir

cwd = os.getcwd()
if len(self._selections) > 0:
files = []
for i in sorted(self._selections.keys()):
Expand All @@ -1036,6 +1043,12 @@ def accept(self, mode=''):
pass
else:
self._getInstance().exitBuffer()

# https:/Yggdroot/LeaderF/issues/257
win_local_cwd = lfEval("getcwd(winnr())")
if cwd != win_local_cwd:
chdir(cwd)

if mode == '':
self._argaddFiles(files)
self._accept(files[0], mode)
Expand All @@ -1055,6 +1068,12 @@ def accept(self, mode=''):
pass
else:
self._getInstance().exitBuffer()

# https:/Yggdroot/LeaderF/issues/257
win_local_cwd = lfEval("getcwd(winnr())")
if cwd != win_local_cwd:
chdir(cwd)

self._accept(file, mode, self._getInstance().buffer, line_nr) # for bufTag

if need_exit:
Expand Down

0 comments on commit bc55aee

Please sign in to comment.