Fix cursor misplacement after CR in front of space
This commit is contained in:
@ -1351,6 +1351,12 @@ function! vimwiki#lst#kbd_cr(normal, just_mrkr) "{{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let insert_new_marker = (a:normal == 1 || a:normal == 3)
|
let insert_new_marker = (a:normal == 1 || a:normal == 3)
|
||||||
|
if getline('.')[col("'^")-1:] =~ '^\s\+$'
|
||||||
|
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\+'),
|
\ strdisplaywidth(matchstr(getline('.')[col("'^")-1:], '\s\+'),
|
||||||
\ virtcol("'^")-1)
|
\ virtcol("'^")-1)
|
||||||
let cur_col -= ws_behind_cursor
|
let cur_col -= ws_behind_cursor
|
||||||
|
Reference in New Issue
Block a user