Closed robertbu closed 2 years ago
Because you are using git, and your command is git ls-files "." && git ls-files --others --exclude-standard -x "build*" "."
.
You can set let g:Lf_UseVersionControlTool = 1
.
Thank you for your quick response.
git ls-files
gives the new file name.
And echo g:Lf_UseVersionControlTool
gives 1 already.
Sorry for mistake.
set let g:Lf_UseVersionControlTool = 0
Actually I've tried that. Now g:Lf_Debug_Cmd utilize the command 'find', instead of 'git'. However,
:exec g:Lf_py "fileExplManager.refresh()"
still give the error:
Traceback (most recent call last): File "
", line 1, in File "/home/robert/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manag er.py", line 2071, in refresh self._search(self._content) File "/home/robert/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manag er.py", line 1082, in _search self._fuzzySearch(content, is_continue, step) File "/home/robert/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manag er.py", line 1498, in _fuzzySearch self._getInstance().setBuffer(self._result_content[:self._initial_count]) File "/home/robert/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/insta nce.py", line 1165, in setBuffer orig_row = self._window_object.cursor[0] vim.error: attempt to refer to deleted window
I think the problem is not that g:Lf_DebugCmd gives the old file name. Actually it gives the correct new file name. It should be that the cache is not updated. I checked the cache file at $HOME/.LfCache/python2/file/cache*. Only the old file name lies in the cache file.
If g:Lf_UseCache == 0, the file won't be written to cache.
Yes, if I set g:Lf_UseCache = 0, that works. LeaderF gives the new file name. This is the way I choose now. Anyhow, I'm wondering why cache does not work. Any hint to find the root cause? Googling "vim.error: attempt to refer to deleted window" does not give many information.
:exec g:Lf_py "fileExplManager.refresh()"
is only available when the LeaderF window is open, otherwise, vim.error: attempt to refer to deleted window
is raised.
I don't know why, I think F5
should work.
With LeaderF Window opened, the refresh command succeeds. Thanks. And I tried \<F5> in another git project, with LeaderF window opened, \<F5> works too. However, the cache file for the project at $HOME/.LfCache/python2/file/ is gone. g:Lf_UseCache is 1. Quite confused.
The cache file is written only when the command of searching files takes more than 1.5 seconds.
Thanks for your response
vim or neovim?
Output of
vim --version
ornvim --version
: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 22 2021 14:48:32) Included patches: 1-3452 Compiled by xxxx Big version with GTK2 GUI. Features included (+) or not (-): +acl +file_in_path +mouse_urxvt -tag_any_white +arabic +find_in_path +mouse_xterm -tcl +autocmd +float +multi_byte +termguicolors +autochdir +folding +multi_lang +terminal -autoservername -footer -mzscheme +terminfo +balloon_eval +fork() +netbeans_intg +termresponse -balloon_eval_term +gettext +num64 +textobjects +browse -hangul_input +packages +textprop ++builtin_terms +iconv +path_extra +timers +byte_offset +insert_expand +perl +title +channel +ipv6 +persistent_undo +toolbar +cindent +job +popupwin +user_commands +clientserver +jumplist +postscript +vartabs +clipboard +keymap +printer +vertsplit +cmdline_compl +lambda -profile +virtualedit +cmdline_hist +langmap +python +visual +cmdline_info +libcall -python3 +visualextra +comments +linebreak +quickfix +viminfo +conceal +lispindent +reltime +vreplace +cryptv +listcmds +rightleft +wildignore +cscope +localmap -ruby +wildmenu +cursorbind -lua +scrollbind +windows +cursorshape +menu +signs +writebackup +dialog_con_gui +mksession +smartindent +X11 +diff +modify_fname -sodium -xfontset +digraphs +mouse -sound +xim +dnd +mouseshape +spell -xpm -ebcdic +mouse_dec +startuptime +xsmp_interact +emacs_tags -mouse_gpm +statusline +xterm_clipboard +eval -mouse_jsbterm -sun_workshop -xterm_save +ex_extra +mouse_netterm +syntax +extra_search +mouse_sgr +tag_binary -farsi -mouse_sysmouse -tag_old_static system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" defaults file: "$VIMRUNTIME/defaults.vim" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/home/STools/GNU/vim-8/share/vim" Compilation: gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman -1 -I/usr/include/libpng15 -I/usr/include/libdrm -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -std=gnu99 -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2- 1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lSM -lICE -lXt -lX11 -lSM -lICE -lm -ltinfo -lelf -lselinux -lacl -latt r -ldl -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib64/p ython2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamicOutput of
:echo has("python")
: 1Output of
:echo has("python3")
: 0Output of
:echo &pythondll
(only vim, not neovim):Output of
:echo &pythonthreedll
(only vim, not neovim):Output of
:py print(sys.version)
: 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]Output of
:py3 print(sys.version)
:Output of
:echo g:Lf_Debug_Cmd
: git ls-files "." && git ls-files --others --exclude-standard -x "build*" "."Output of
:echo g:Lf_FilesFromCache
: 1Operating system:
Configurations related to LeaderF in vimrc:
Describe your question, feature request, or bug.
Press \<F5> to refresh cache seems to have no effect. I changed some file name with "git mv". However, when using searching files, I still got the old file name. Setting "g:Lf_UseCache = 0" does work. Also tried the command
:exec g:Lf_py "fileExplManager.refresh()"
It gives me some error message as shown below:
Anyway, it's a great plugin. Thank you.
Steps to reproduce
Actual behaviour
Expected behaviour