mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-22 08:45:42 +08:00
parent
1cd9404d42
commit
0c5b68ab2a
@ -255,6 +255,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:search_status() abort
|
function! s:search_status() abort
|
||||||
|
let save_cursor = getpos('.')
|
||||||
let ct = 0
|
let ct = 0
|
||||||
let tt = 0
|
let tt = 0
|
||||||
let ctl = split(s:VIMCOMP.execute('keeppatterns .,$s/' . @/ . '//gn', 'silent!'), "\n")
|
let ctl = split(s:VIMCOMP.execute('keeppatterns .,$s/' . @/ . '//gn', 'silent!'), "\n")
|
||||||
@ -265,6 +266,7 @@ function! s:search_status() abort
|
|||||||
if !empty(ctl)
|
if !empty(ctl)
|
||||||
let tt = split(ttl[0])[0]
|
let tt = split(ttl[0])[0]
|
||||||
endif
|
endif
|
||||||
|
keepjumps call setpos('.', save_cursor)
|
||||||
return ' ' . (str2nr(tt) - str2nr(ct) + 1) . '/' . tt . ' '
|
return ' ' . (str2nr(tt) - str2nr(ct) + 1) . '/' . tt . ' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -101,10 +101,10 @@ function! s:update_search_index(key) abort
|
|||||||
normal! N
|
normal! N
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
normal! ml
|
let save_cursor = getpos('.')
|
||||||
if !SpaceVim#layers#core#statusline#check_section('search status')
|
if !SpaceVim#layers#core#statusline#check_section('search status')
|
||||||
call SpaceVim#layers#core#statusline#toggle_section('search status')
|
call SpaceVim#layers#core#statusline#toggle_section('search status')
|
||||||
endif
|
endif
|
||||||
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||||
normal! `l
|
keepjumps call setpos('.', save_cursor)
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user