mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 18:06:30 +00:00
fix(ui): wrong cursor position with left gravity inline virt text at eol
This commit is contained in:
@@ -862,15 +862,6 @@ void curs_columns(win_T *wp, int may_scroll)
|
||||
n = (wp->w_wcol - wp->w_width_inner) / width2 + 1;
|
||||
wp->w_wcol -= n * width2;
|
||||
wp->w_wrow += n;
|
||||
|
||||
// When cursor wraps to first char of next line in Insert
|
||||
// mode, the 'showbreak' string isn't shown, backup to first
|
||||
// column
|
||||
char *const sbr = get_showbreak_value(wp);
|
||||
if (*sbr && *get_cursor_pos_ptr() == NUL
|
||||
&& wp->w_wcol == (wp->w_width_inner - width2) + vim_strsize(sbr)) {
|
||||
wp->w_wcol = 0;
|
||||
}
|
||||
}
|
||||
} else if (may_scroll
|
||||
&& !wp->w_cline_folded) {
|
||||
|
@@ -359,7 +359,7 @@ int win_lbr_chartabsize(chartabsize_T *cts, int *headp)
|
||||
if (width <= 0) {
|
||||
width = 1;
|
||||
}
|
||||
// divide "size - prev_width" by "width", rounding up
|
||||
// Divide "size - prev_rem" by "width", rounding up.
|
||||
int cnt = (size - prev_rem + width - 1) / width;
|
||||
added += cnt * head_mid;
|
||||
|
||||
@@ -371,7 +371,11 @@ int win_lbr_chartabsize(chartabsize_T *cts, int *headp)
|
||||
} else if (max_head_vcol < 0) {
|
||||
int off = virt_text_cursor_off(cts, c == NUL);
|
||||
if (off >= prev_rem) {
|
||||
head += (1 + (off - prev_rem) / width) * head_mid;
|
||||
if (size > off) {
|
||||
head += (1 + (off - prev_rem) / width) * head_mid;
|
||||
} else {
|
||||
head += (off - prev_rem + width - 1) / width * head_mid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user