diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 43 | ||||
-rw-r--r-- | src/nvim/message.c | 23 | ||||
-rw-r--r-- | src/nvim/screen.c | 8 | ||||
-rw-r--r-- | src/nvim/version.c | 8 |
4 files changed, 49 insertions, 33 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d84bdfebfe..9e23753833 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8337,6 +8337,7 @@ static void f_cursor(typval_T *argvars, typval_T *rettv) { long line, col; long coladd = 0; + bool set_curswant = true; rettv->vval.v_number = -1; if (argvars[1].v_type == VAR_UNKNOWN) { @@ -8353,30 +8354,35 @@ static void f_cursor(typval_T *argvars, typval_T *rettv) coladd = pos.coladd; if (curswant >= 0) { curwin->w_curswant = curswant - 1; + set_curswant = false; } } else { line = get_tv_lnum(argvars); col = get_tv_number_chk(&argvars[1], NULL); - if (argvars[2].v_type != VAR_UNKNOWN) + if (argvars[2].v_type != VAR_UNKNOWN) { coladd = get_tv_number_chk(&argvars[2], NULL); + } } if (line < 0 || col < 0 - || coladd < 0 - ) - return; /* type error; errmsg already given */ - if (line > 0) + || coladd < 0) { + return; // type error; errmsg already given + } + if (line > 0) { curwin->w_cursor.lnum = line; - if (col > 0) + } + if (col > 0) { curwin->w_cursor.col = col - 1; + } curwin->w_cursor.coladd = coladd; - /* Make sure the cursor is in a valid position. */ + // Make sure the cursor is in a valid position. check_cursor(); - /* Correct cursor for multi-byte character. */ - if (has_mbyte) + // Correct cursor for multi-byte character. + if (has_mbyte) { mb_adjust_cursor(); + } - curwin->w_set_curswant = TRUE; + curwin->w_set_curswant = set_curswant; rettv->vval.v_number = 0; } @@ -14682,25 +14688,30 @@ static void f_setpos(typval_T *argvars, typval_T *rettv) name = get_tv_string_chk(argvars); if (name != NULL) { if (list2fpos(&argvars[1], &pos, &fnum, &curswant) == OK) { - if (--pos.col < 0) + if (--pos.col < 0) { pos.col = 0; + } if (name[0] == '.' && name[1] == NUL) { - /* set cursor */ + // set cursor if (fnum == curbuf->b_fnum) { curwin->w_cursor = pos; if (curswant >= 0) { curwin->w_curswant = curswant - 1; + curwin->w_set_curswant = false; } check_cursor(); rettv->vval.v_number = 0; - } else + } else { EMSG(_(e_invarg)); + } } else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL) { - /* set mark */ - if (setmark_pos(name[1], &pos, fnum) == OK) + // set mark + if (setmark_pos(name[1], &pos, fnum) == OK) { rettv->vval.v_number = 0; - } else + } + } else { EMSG(_(e_invarg)); + } } } } diff --git a/src/nvim/message.c b/src/nvim/message.c index f60b128712..265f8c00c0 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -467,22 +467,23 @@ int emsg(char_u *s) { int attr; char_u *p; - int ignore = FALSE; + int ignore = false; int severe; - /* Skip this if not giving error messages at the moment. */ - if (emsg_not_now()) - return TRUE; + // Skip this if not giving error messages at the moment. + if (emsg_not_now()) { + return true; + } - called_emsg = TRUE; - ex_exitval = 1; + called_emsg = true; + if (emsg_silent == 0) { + ex_exitval = 1; + } - /* - * If "emsg_severe" is TRUE: When an error exception is to be thrown, - * prefer this message over previous messages for the same command. - */ + // If "emsg_severe" is TRUE: When an error exception is to be thrown, + // prefer this message over previous messages for the same command. severe = emsg_severe; - emsg_severe = FALSE; + emsg_severe = false; if (!emsg_off || vim_strchr(p_debug, 't') != NULL) { /* diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 59168b29a0..10b5b6bba4 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3693,9 +3693,13 @@ win_line ( && wp == curwin && lnum == wp->w_cursor.lnum && conceal_cursor_line(wp) && (int)wp->w_virtcol <= vcol + n_skip) { - wp->w_wcol = col - boguscols; + if (wp->w_p_rl) { + wp->w_wcol = wp->w_width - col + boguscols - 1; + } else { + wp->w_wcol = col - boguscols; + } wp->w_wrow = row; - did_wcol = TRUE; + did_wcol = true; } /* Don't override visual selection highlighting. */ diff --git a/src/nvim/version.c b/src/nvim/version.c index 723eceee2e..69d423f531 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -116,7 +116,7 @@ static int included_patches[] = { // 1565, // 1564, // 1563, - // 1562, + // 1562 NA // 1561 NA // 1560, // 1559, @@ -331,7 +331,7 @@ static int included_patches[] = { // 1350 NA // 1349 NA // 1348 NA - // 1347, + 1347, 1346, // 1345 NA // 1344 NA @@ -577,7 +577,7 @@ static int included_patches[] = { // 1104 NA // 1103 NA // 1102, - // 1101, + 1101, // 1100 NA // 1099 NA // 1098 NA @@ -663,7 +663,7 @@ static int included_patches[] = { // 1018, // 1017, // 1016 NA - // 1015, + 1015, // 1014 NA 1013, // 1012 NA |