This commit is contained in:
Adam Stankiewicz
2015-05-11 15:05:13 +02:00
parent acd7ce5950
commit 271b63d717
33 changed files with 712 additions and 382 deletions

View File

@@ -101,9 +101,21 @@ function! Latexbox_CallIndent()
let window = getpos('.')
call setpos('.', cursor)
" Get first non-whitespace character of current line.
let line_start_char = matchstr(getline('.'), '\S')
" Get initial tab position.
let initial_tab = stridx(getline('.'), line_start_char)
" Execute the command.
execute 'normal! =='
" Get tab position difference.
let difference = stridx(getline('.'), line_start_char) - initial_tab
" Set new cursor Y position based on calculated difference.
let cursor[2] = cursor[2] + difference
" Restore the previous window position.
call setpos('.', window)
normal! zt