diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-10 15:05:02 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-08-07 14:21:23 +0200 |
commit | 41fa6079b268dcf52bda85d8ebd87313c0ef4164 (patch) | |
tree | a738af5068e31cf9ca5255d8838a0ee35bfa4b5b | |
parent | be08d52e1119b58b9e7a49343d8a6c64eefe4fdb (diff) | |
download | rneovim-41fa6079b268dcf52bda85d8ebd87313c0ef4164.tar.gz rneovim-41fa6079b268dcf52bda85d8ebd87313c0ef4164.tar.bz2 rneovim-41fa6079b268dcf52bda85d8ebd87313c0ef4164.zip |
lint/sync: truncate_line
-rw-r--r-- | src/nvim/change.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index 0273c6fa33..96497dbf0f 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -1749,11 +1749,9 @@ theend: /* * Delete from cursor to end of line. * Caller must have prepared for undo. + * If "fixpos" is TRUE fix the cursor position when done. */ -void -truncate_line ( - int fixpos /* if TRUE fix the cursor position when done */ -) +void truncate_line(int fixpos) { char_u *newp; linenr_T lnum = curwin->w_cursor.lnum; @@ -1766,14 +1764,13 @@ truncate_line ( } ml_replace(lnum, newp, false); - /* mark the buffer as changed and prepare for displaying */ + // mark the buffer as changed and prepare for displaying changed_bytes(lnum, curwin->w_cursor.col); - /* - * If "fixpos" is TRUE we don't want to end up positioned at the NUL. - */ - if (fixpos && curwin->w_cursor.col > 0) - --curwin->w_cursor.col; + // If "fixpos" is TRUE we don't want to end up positioned at the NUL. + if (fixpos && curwin->w_cursor.col > 0) { + curwin->w_cursor.col--; + } } /* |