diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2015-05-11 15:05:13 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2015-05-11 15:05:13 +0200 |
commit | 271b63d71707720ad0d35590b8cb50f8f8f43014 (patch) | |
tree | 1b71daa457afc68465f66ee2afc9a00c1380f23d /indent/tex.vim | |
parent | acd7ce59503b22ac7663fc25776efe25e266f1d4 (diff) | |
download | vim-polyglot-1.13.2.tar.gz vim-polyglot-1.13.2.zip |
Updatev1.13.2
Diffstat (limited to 'indent/tex.vim')
-rw-r--r-- | indent/tex.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indent/tex.vim b/indent/tex.vim index e7653d03..3abc44ba 100644 --- a/indent/tex.vim +++ b/indent/tex.vim @@ -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 |