vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit 19e4cf90ef86d1b150da9565360220a9cd6e8143
parent ea95f3fc365e2783619c44d11b5e98160afefb40
Author: EinfachToll <istjanichtzufassen@googlemail.de>
Date:   Mon,  6 Jan 2014 13:07:56 +0100

Fix cursor misplacement after CR in front of space

Diffstat:
Mautoload/vimwiki/lst.vim | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/autoload/vimwiki/lst.vim b/autoload/vimwiki/lst.vim @@ -1351,6 +1351,12 @@ function! vimwiki#lst#kbd_cr(normal, just_mrkr) "{{{ let cur_col = 0 else let cur_col = col("$") - col("'^") + if getline('.')[col("'^")-1] =~ '\s' && exists("*strdisplaywidth") + let ws_behind_cursor = + \ strdisplaywidth(matchstr(getline('.')[col("'^")-1:], '\s\+'), + \ virtcol("'^")-1) + let cur_col -= ws_behind_cursor + endif if insert_new_marker && cur_col == 0 && getline(lnum) =~ '\s$' let insert_new_marker = 0 endif