Yggdroot / LeaderF

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.
Apache License 2.0
2.13k stars 180 forks source link

Error detected while processing function leaderf#Any#start[4]..leaderf#LfPy[1]..provider#python3#Call: #955

Closed astroshot closed 1 year ago

astroshot commented 2 years ago

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.7.2_1/share/nvim"

Run :checkhealth for more info

- Output of `:echo has("python")`:  0
- Output of `:echo has("python3")`:  1
- Output of `:echo &pythondll`(only vim, not neovim): 
- Output of `:echo &pythonthreedll`(only vim, not neovim): 
- Output of `:py print(sys.version)`: 

3.10.6 (main, Aug 30 2022, 04:58:14) [Clang 13.1.6 (clang-1316.0.21.2.5)]

- Output of `:py3 print(sys.version)`: 

3.10.6 (main, Aug 30 2022, 04:58:14) [Clang 13.1.6 (clang-1316.0.21.2.5)]

- Output of `:echo g:Lf_Debug_Cmd`: <!-- should only provide this information if it's an issue of :Leaderf file -->
- Output of `:echo g:Lf_FilesFromCache`: <!-- should only provide this information if it's an issue of :Leaderf file -->
- Operating system: <!-- use [x] to select, note: no space in between brackets -->
    - [ ] Linux
    - [x] Mac OS X
    - [ ] Windows
    - [ ] Etc.
- Configurations related to LeaderF in vimrc: 

" leaderF config let g:Lf_ShortcutF = "ff" noremap fb :=printf("Leaderf buffer %s", "") noremap fm :=printf("Leaderf mru %s", "") noremap ft :=printf("Leaderf bufTag %s", "") noremap fl :=printf("Leaderf line %s", "") " let g:Lf_WindowPosition = 'popup' " 禁用缓存 let g:Lf_UseCache = 0 let g:Lf_UseVersionControlTool = 0 let g:Lf_UseMemoryCache = 0 let g:Lf_PreviewInPopup = 1 let g:Lf_StlSeparator = { 'left': "\ue0b0", 'right': "\ue0b2", 'font': "DejaVu Sans Mono for Powerline" } let g:Lf_PreviewResult = {'Function': 1, 'BufTag': 0, 'File': 1 } " 设置项目根目录模式 let g:Lf_WorkingDirectoryMode = 'AF' let g:Lf_RootMarkers = ['.git', '.svn', '.hg', '.project', '.root'] " autocmd BufNewFile,BufRead X:/yourdir let g:Lf_WildIgnore={'file':['.vcproj', '.vcxproj'],'dir':[]} let g:Lf_WildIgnore={ \ 'file':['.vcproj', '.vcxproj', '.exe', '.so', '.sw?', '.o', '.py[co]'], \ 'dir':['.git', '.node_modules', '.hg',] \ } let g:Lf_StlColorscheme = 'powerline'

if has('nvim') let s:cachedir = expand(stdpath('cache')) let s:configdir = expand(stdpath('config')) else "vim will share same folder with nvim if has('win32') let s:cachedir = expand('~/AppData/Local/Temp/cache/nvim') let s:configdir = expand('~/AppData/Local/nvim') else let s:cachedir = expand('~/.cache/nvim') let s:configdir = expand('~/.config/nvim') endif endif let g:Lf_CacheDirectory = s:cachedir


### Describe your question, feature request, or bug.

### Steps to reproduce
Open a folder, then shows startify page. 
![图片](https://user-images.githubusercontent.com/24741314/190567169-61428ee5-3718-4d17-9a8a-3af5c65b0b12.png)

Press <leader>ff to show search ui, then press key `a`, `r`, `e`  then it happens.

![图片](https://user-images.githubusercontent.com/24741314/190567261-9e309f59-1334-4016-99d1-0633f75e5845.png)

### Actual behaviour

Error detected while processing function leaderf#Any#start[4]..leaderf#LfPy[1]..provider#python3#Call: line 18: Error invoking 'python_execute' on channel 4 (python3-script-host): Traceback (most recent call last): File "", line 1, in File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/anyExpl.py", line 815, in start the_args.start(arguments, *args, kwargs) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/anyExpl.py", line 747, in _default_action manager.startExplorer(win_pos[2:], *args, *kwargs) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/fileExpl.py", line 852, in startExplorer super(FileExplManager, self).startExplorer(win_pos, args, kwargs) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 2431, in startExplorer self.input() File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 62, in deco func(self, *args, kwargs) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 2657, in input self._search(cur_content) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 1187, in _search self._previewResult(False) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 393, in _previewResult self._previewInPopup(line, self._getInstance().buffer, line_nr) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/devicons.py", line 414, in deco return func(*args, *kwargs) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/fileExpl.py", line 867, in _previewInPopup self._createPopupPreview(line, source, 0) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 91, in deco func(self, args, kwargs) File "/Users/liuzhao11/.config/nvim/plug/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 821, in _createPopupPreview self._preview_winid = int(lfEval("nvim_open_win(scratch_buffer, 0, %s)" % str(config))) File "/opt/homebrew/lib/python3.10/site-packages/pynvim/plugin/script_host.py", line 205, in eval obj = self.request("vim_eval", expr) File "/opt/homebrew/lib/python3.10/site-packages/pynvim/api/nvim.py", line 182, in request res = self._session.request(name, *args, **kwargs) File "/opt/homebrew/lib/python3.10/site-packages/pynvim/msgpack_rpc/session.py", line 102, in request raise self.error_wrapper(err) pynvim.api.common.NvimError: Vim:E5555: API call: 'height' key must be a positive Integer


### Expected behaviour

![图片](https://user-images.githubusercontent.com/24741314/190567744-2821a8a7-6489-4633-a436-d1043ef319e1.png)

It is strange that, search text starts with `a`, `r`, `e` will trigger this problem (I haven't try other keys). 
So any help?
astroshot commented 2 years ago

It's OK on my linux with the same config. That's weird...

Yggdroot commented 1 year ago

It's OK on my linux with the same config. That's weird...

This issue can be easily reproduced if there is empty file.