mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +00:00
fix(column): fix wrong cursor with 'statuscolumn' and cpo+=n (#24268)
This commit is contained in:
@@ -748,7 +748,7 @@ static void get_statuscol_display_info(statuscol_T *stcp, winlinevars_T *wlv)
|
||||
// Skip over empty highlight sections
|
||||
} while (wlv->n_extra == 0 && stcp->textp < stcp->text_end);
|
||||
if (wlv->n_extra > 0) {
|
||||
static char transbuf[MAX_NUMBERWIDTH * MB_MAXBYTES + 1];
|
||||
static char transbuf[(MAX_NUMBERWIDTH + 9 + 9 * 2) * MB_MAXBYTES + 1];
|
||||
wlv->n_extra = (int)transstr_buf(wlv->p_extra, wlv->n_extra, transbuf, sizeof transbuf, true);
|
||||
wlv->p_extra = transbuf;
|
||||
}
|
||||
|
@@ -775,9 +775,9 @@ void validate_cursor_col(void)
|
||||
// fold column and sign column (these don't move when scrolling horizontally).
|
||||
int win_col_off(win_T *wp)
|
||||
{
|
||||
return ((wp->w_p_nu || wp->w_p_rnu || (*wp->w_p_stc != NUL)) ?
|
||||
return ((wp->w_p_nu || wp->w_p_rnu || *wp->w_p_stc != NUL) ?
|
||||
(number_width(wp) + (*wp->w_p_stc == NUL)) : 0)
|
||||
+ (cmdwin_type == 0 || wp != curwin ? 0 : 1)
|
||||
+ ((cmdwin_type == 0 || wp != curwin) ? 0 : 1)
|
||||
+ win_fdccol_count(wp)
|
||||
+ (win_signcol_count(wp) * win_signcol_width(wp));
|
||||
}
|
||||
@@ -792,8 +792,9 @@ int curwin_col_off(void)
|
||||
// is in 'cpoptions'.
|
||||
int win_col_off2(win_T *wp)
|
||||
{
|
||||
if ((wp->w_p_nu || wp->w_p_rnu) && vim_strchr(p_cpo, CPO_NUMCOL) != NULL) {
|
||||
return number_width(wp) + 1;
|
||||
if ((wp->w_p_nu || wp->w_p_rnu || *wp->w_p_stc != NUL)
|
||||
&& vim_strchr(p_cpo, CPO_NUMCOL) != NULL) {
|
||||
return number_width(wp) + (*wp->w_p_stc == NUL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user