-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
leaderf 自定义 扩展与vim python3 出现兼容性问题 #209
Labels
Comments
fix了,试一下,在dev branch。 |
function! te#leaderf#dir#accept(line, args) abort
let l:file_or_dir=matchstr(a:line,".*[^@]")
if isdirectory(l:file_or_dir)
execute 'cd 'l:file_or_dir
:Leaderf dir
else
execute 'e '.l:file_or_dir
endif
endfunction 这个函数调用:Leaderf dir 这样实现,是退出去再进来有点不舒服,我增加了一个函数: function! te#leaderf#dir#needExit(line, args) abort
let l:file_or_dir=matchstr(a:line,".*[^@]")
if isdirectory(l:file_or_dir)
return 0 "不退出
else
return 1
endif
endfunction let g:Lf_Extensions = {
\ "dir": {
\ "source": function("te#leaderf#dir#source"),
\ "need_exit": function("te#leaderf#dir#needExit"),
\ "accept": function("te#leaderf#dir#accept"),
\ "supports_name_only": 1,
\ "supports_multi": 0,
\ }, |
accept函数也要相应的修改。 function! te#leaderf#dir#accept(line, args) abort
let l:file_or_dir=matchstr(a:line,".*[^@]")
if isdirectory(l:file_or_dir)
execute 'cd 'l:file_or_dir
把这个目录下的文件或目录再列出来
else
execute 'e '.l:file_or_dir
endif
endfunction |
function! te#leaderf#dir#accept(line, args) abort
let l:file_or_dir=matchstr(a:line,".*[^@]")
if isdirectory(l:file_or_dir)
execute 'cd 'l:file_or_dir
let source = te#leaderf#dir#source(0)
norm! ggdG
call setline(1, source)
else
execute 'e '.l:file_or_dir
endif
endfunction 我的意思大致就是这个函数,不过高亮好像有bug,我再看看。 |
使用最新的dev branch,应该没什么问题了。 |
Leaderf dir 这个功能我打算原生支持了,也许可以吸引一些用户,到时候希望能提出一些建议。 |
Awesome!,问题解决。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/tracyone/vinux/blob/leaderf_extend/autoload/te/leaderf/dir.vim#L1-L50
https://github.com/tracyone/vinux/blob/leaderf_extend/rc/jump.vim#L34-L41
注意把代码里面的
te#compatiable#systemlist
换成systemlist函数即可。问题描述:
vim 最新版本(几乎),使能python3,
echo has('python3)
为1.leaderf插件的版本为最新
dev
分支。执行上面的
Leaderf dir
的时候,首次进入界面没有错误,但是一开始输入字就出现下面截图错误:这个问题可以在ubuntu 16.04.4和macOS 10.13.6上复现。
The text was updated successfully, but these errors were encountered: