From ab5083b5fc9fc8c62dae6aefc4fb2615a61c6fff Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 23 Feb 2021 22:49:57 -0500 Subject: pos: define MAXCOL to INT_MAX Partial port of patch v8.1.0953. Remove useless casts on MAXCOL. --- src/nvim/ops.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/ops.c') 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() */ -- cgit