mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-07 12:44:27 +08:00
Cursor position is wrong on startup
This commit is contained in:
@@ -127,6 +127,13 @@ function! s:DisableOnDiff()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"{{{1 function! s:VimEnter()
|
||||||
|
function! s:VimEnter()
|
||||||
|
let init_winnr = winnr()
|
||||||
|
noautocmd windo call s:DisableOnDiff()
|
||||||
|
noautocmd exec init_winnr . "wincmd w"
|
||||||
|
endfunction
|
||||||
|
|
||||||
"{{{1 function! s:ToggleOnDiff()
|
"{{{1 function! s:ToggleOnDiff()
|
||||||
function! s:ToggleOnDiff()
|
function! s:ToggleOnDiff()
|
||||||
if &diff
|
if &diff
|
||||||
@@ -394,7 +401,7 @@ augroup indentLine
|
|||||||
if exists("##OptionSet")
|
if exists("##OptionSet")
|
||||||
autocmd OptionSet diff call s:ToggleOnDiff()
|
autocmd OptionSet diff call s:ToggleOnDiff()
|
||||||
endif
|
endif
|
||||||
autocmd VimEnter * noautocmd windo call s:DisableOnDiff()
|
autocmd VimEnter * call s:VimEnter()
|
||||||
else
|
else
|
||||||
autocmd BufWinEnter * call s:Setup()
|
autocmd BufWinEnter * call s:Setup()
|
||||||
autocmd User * if exists("b:indentLine_enabled") || exists("b:indentLine_leadingSpaceEnabled") |
|
autocmd User * if exists("b:indentLine_enabled") || exists("b:indentLine_leadingSpaceEnabled") |
|
||||||
@@ -406,7 +413,7 @@ augroup indentLine
|
|||||||
if exists("##OptionSet")
|
if exists("##OptionSet")
|
||||||
autocmd OptionSet diff call s:ToggleOnDiff()
|
autocmd OptionSet diff call s:ToggleOnDiff()
|
||||||
endif
|
endif
|
||||||
autocmd VimEnter * noautocmd windo call s:DisableOnDiff()
|
autocmd VimEnter * call s:VimEnter()
|
||||||
endif
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user