diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-24 09:26:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-24 09:26:17 -0500 |
commit | d290da70b76a2dcd99591ec1a175a4ae29f64bfd (patch) | |
tree | ff1820ca53dfe5484414a643339f8d136d7f0ceb /src/nvim/ops.c | |
parent | 6b7cc45c4845624aa08232a860941b5a55b9640b (diff) | |
parent | ab5083b5fc9fc8c62dae6aefc4fb2615a61c6fff (diff) | |
download | rneovim-d290da70b76a2dcd99591ec1a175a4ae29f64bfd.tar.gz rneovim-d290da70b76a2dcd99591ec1a175a4ae29f64bfd.tar.bz2 rneovim-d290da70b76a2dcd99591ec1a175a4ae29f64bfd.zip |
Merge pull request #14001 from janlazo/vim-8.2.2545
vim-patch:8.2.{2545,2547,2548}
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index ea52d6a3d3..3038fad894 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -4305,11 +4305,12 @@ format_lines( * tabs and spaces, according to current options */ (void)set_indent(get_indent(), SIN_CHANGED); - /* put cursor on last non-space */ - State = NORMAL; /* don't go past end-of-line */ - coladvance((colnr_T)MAXCOL); - while (curwin->w_cursor.col && ascii_isspace(gchar_cursor())) + // put cursor on last non-space + State = NORMAL; // don't go past end-of-line + coladvance(MAXCOL); + while (curwin->w_cursor.col && ascii_isspace(gchar_cursor())) { dec_cursor(); + } /* do the formatting, without 'showmode' */ State = INSERT; /* for open_line() */ |