mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-02-08 05:59:46 +08:00
remove space at end of appended comment
This commit is contained in:
parent
0b3d928dce
commit
1f06d8a4dd
|
@ -530,12 +530,12 @@ function s:AppendCommentToLine()
|
||||||
|
|
||||||
"stick the delimiters down at the end of the line. We have to format the
|
"stick the delimiters down at the end of the line. We have to format the
|
||||||
"comment with spaces as appropriate
|
"comment with spaces as appropriate
|
||||||
execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right . " "
|
execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right
|
||||||
|
|
||||||
" if there is a right delimiter then we gotta move the cursor left
|
" if there is a right delimiter then we gotta move the cursor left
|
||||||
" by the len of the right delimiter so we insert between the delimiters
|
" by the len of the right delimiter so we insert between the delimiters
|
||||||
if lenRight > 0
|
if lenRight > 0
|
||||||
let leftMoveAmount = lenRight
|
let leftMoveAmount = lenRight - 1
|
||||||
execute ":normal! " . leftMoveAmount . "h"
|
execute ":normal! " . leftMoveAmount . "h"
|
||||||
endif
|
endif
|
||||||
startinsert
|
startinsert
|
||||||
|
|
Loading…
Reference in New Issue
Block a user