LeaderF icon indicating copy to clipboard operation
LeaderF copied to clipboard

"pynvim.api.common.NvimError: Vim:E5555: API call: border chars must be one cell"when run "LeaderF file" in Neovim command line

Open ziyangzheng opened this issue 1 year ago • 6 comments

  • vim or neovim?
    • [ ] vim
    • [x] neovim
  • Output of vim --version or nvim --version:
  • 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.12.3 (main,Sep 11 2024, 14:17:37) [GCC 13.2.0]
  • Output of :py3 print(sys.version): 3.12.3 (main,Sep 11 2024, 14:17:37) [GCC 13.2.0]
  • Output of :echo g:Lf_Debug_Cmd:
  • Output of :echo g:Lf_FilesFromCache:
  • Operating system:
    • [x] Linux
    • [ ] Mac OS X
    • [ ] Windows
    • [ ] Etc.
  • Configurations related to LeaderF in vimrc: Only “ Plug 'Yggdroot/LeaderF' ” for LeaderF and nothing else,but i have coc.nvim installed.

Describe your question, feature request, or bug.

When i run cmd :LeaderF file,i always get the following error:

处理 function leaderf#Any#start[4]..leaderf#LfPy[1]..provider#python3#Call 时发>
生错误:
第   18 行:                                                           
Error invoking 'python_execute' on channel 5 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/anyExpl
.py", line 841, in start
    the_args.start(arguments, *args, **kwargs)
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/anyExpl
.py", line 759, in _default_action
    manager.startExplorer(win_pos[2:], *args, **kwargs)
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/fileExp
l.py", line 827, in startExplorer
    super(FileExplManager, self).startExplorer(win_pos, *args, **kwargs)
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager
.py", line 2885, in startExplorer
    self._previewFirstLine()
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager
.py", line 2710, in _previewFirstLine
    self._previewResult(False)
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager
.py", line 446, in _previewResult
self._previewInPopup(line, self._getInstance().buffer, line_num)
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/devicon
s.py", line 417, in deco
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/fileExp
l.py", line 845, in _previewInPopup
    self._createPopupPreview(line, source, 0)
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/utils.p
y", line 1427, in deco
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager
.py", line 1127, in _createPopupPreview
    self._createPreviewWindow(config, source, line_num, jump_cmd)
  File "/home/charx/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager
.py", line 547, in _createPreviewWindow
    self._preview_winid = int(lfEval("nvim_open_win(g:Lf_preview_scratch_buffer,
 0, %s)" % str(config)))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pynvim/plugin/script_host.py", line 210, in eval
    obj = self.request("vim_eval", expr)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 199, in request
    res = self._session.request(name, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 139, in request
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim:E5555: API call: border chars must be one cell

Steps to reproduce

nvim
#run ":LeaderF file" in nvim command line

Actual behaviour

The above error occurred.

Expected behaviour

ziyangzheng avatar Oct 15 '24 16:10 ziyangzheng

what is the version of nvim?

Yggdroot avatar Oct 16 '24 01:10 Yggdroot

what is the version of nvim?

NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377

ziyangzheng avatar Oct 16 '24 04:10 ziyangzheng

Could you provide a minimal vimrc to reproduce it?

Yggdroot avatar Oct 16 '24 09:10 Yggdroot

Sure,here is my init.nvim,only LeaderF plugins selected.

call plug#begin('~/.vim/plugged')
Plug 'Yggdroot/LeaderF'
call plug#end()

" Base NVIM Start
" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
filetype plugin on
" 设置为双字宽显示,否则无法完整显示如:☆
set ambiwidth=double
set t_ut= " 防止vim背景颜色错误
set showmatch " 高亮匹配括号
set matchtime=1
set report=0
set ignorecase
set nocompatible
set noeb
set softtabstop=4
set shiftwidth=4
set nobackup
set autoread
set nocompatible
set nu "设置显示行号
set backspace=2 "能使用backspace回删
syntax on "语法检测
set ruler "显示最后一行的状态
set laststatus=2 "两行状态行+一行命令行
set ts=4
set expandtab
set autoindent "设置c语言自动对齐
set t_Co=256 "指定配色方案为256
" set mouse=a "设置可以在VIM使用鼠标
set selection=exclusive
" set selectmode=mouse,key
set tabstop=4 "设置TAB宽度
set history=1000 "设置历史记录条数   
" 配色方案
" let g:seoul256_background = 234
" colo monokai 未安装
"共享剪切板
set clipboard+=unnamed 
set cmdheight=3
if version >= 603
     set helplang=cn
     set encoding=utf-8
endif
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8
set updatetime=300
set shortmess+=c
set signcolumn=yes
 
" autocmd FileType json syntax match Comment +\/\/.\+$+
 
set foldmethod=indent " 设置默认折叠方式为缩进
set foldlevelstart=99 " 每次打开文件时关闭折叠
 
let g:python3_host_prog='/usr/bin/python3.12'

" hi Normal ctermfg=252 ctermbg=none "背景透明
" au FileType gitcommit,gitrebase let g:gutentags_enabled=0
if has("autocmd")
    au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" Base NVIM End
" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

ziyangzheng avatar Oct 16 '24 10:10 ziyangzheng

Sure,here is my init.nvim,only LeaderF plugins selected.

call plug#begin('~/.vim/plugged')
Plug 'Yggdroot/LeaderF'
call plug#end()

" Base NVIM Start
" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
filetype plugin on
" 设置为双字宽显示,否则无法完整显示如:☆
set ambiwidth=double
set t_ut= " 防止vim背景颜色错误
set showmatch " 高亮匹配括号
set matchtime=1
set report=0
set ignorecase
set nocompatible
set noeb
set softtabstop=4
set shiftwidth=4
set nobackup
set autoread
set nocompatible
set nu "设置显示行号
set backspace=2 "能使用backspace回删
syntax on "语法检测
set ruler "显示最后一行的状态
set laststatus=2 "两行状态行+一行命令行
set ts=4
set expandtab
set autoindent "设置c语言自动对齐
set t_Co=256 "指定配色方案为256
" set mouse=a "设置可以在VIM使用鼠标
set selection=exclusive
" set selectmode=mouse,key
set tabstop=4 "设置TAB宽度
set history=1000 "设置历史记录条数   
" 配色方案
" let g:seoul256_background = 234
" colo monokai 未安装
"共享剪切板
set clipboard+=unnamed 
set cmdheight=3
if version >= 603
     set helplang=cn
     set encoding=utf-8
endif
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8
set updatetime=300
set shortmess+=c
set signcolumn=yes
 
" autocmd FileType json syntax match Comment +\/\/.\+$+
 
set foldmethod=indent " 设置默认折叠方式为缩进
set foldlevelstart=99 " 每次打开文件时关闭折叠
 
let g:python3_host_prog='/usr/bin/python3.12'

" hi Normal ctermfg=252 ctermbg=none "背景透明
" au FileType gitcommit,gitrebase let g:gutentags_enabled=0
if has("autocmd")
    au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" Base NVIM End
" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

When i remove the 'Base NVIM' block,the error has disappeared

ziyangzheng avatar Oct 16 '24 11:10 ziyangzheng

Please remove set ambiwidth=double.

Yggdroot avatar Oct 17 '24 05:10 Yggdroot

when i remove the item 'set ambiwidth=double',the error disappeared,thanks for you fast reply!

ziyangzheng avatar Oct 18 '24 11:10 ziyangzheng