mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
fix(ui): redraw end of buffer if last line is modified (#20354)
This commit is contained in:
@@ -1965,7 +1965,8 @@ win_update_start:
|
|||||||
if (mid_end >= row) {
|
if (mid_end >= row) {
|
||||||
lastline = MIN(lastline, mid_start);
|
lastline = MIN(lastline, mid_start);
|
||||||
}
|
}
|
||||||
if (mod_bot > buf->b_ml.ml_line_count + 1) {
|
// if (mod_bot > buf->b_ml.ml_line_count + 1) {
|
||||||
|
if (mod_bot > buf->b_ml.ml_line_count) {
|
||||||
lastline = 0;
|
lastline = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1281,6 +1281,110 @@ if (h->n_buckets < new_n_buckets) { // expand
|
|||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('works beyond end of the buffer with virt_lines_above', function()
|
||||||
|
insert(example_text)
|
||||||
|
feed 'G'
|
||||||
|
|
||||||
|
screen:expect{grid=[[
|
||||||
|
if (h->n_buckets < new_n_buckets) { // expand |
|
||||||
|
khkey_t *new_keys = (khkey_t *)krealloc((void *)|
|
||||||
|
h->keys, new_n_buckets * sizeof(khkey_t)); |
|
||||||
|
h->keys = new_keys; |
|
||||||
|
if (kh_is_map && val_size) { |
|
||||||
|
char *new_vals = krealloc( h->vals_buf, new_n_|
|
||||||
|
buckets * val_size); |
|
||||||
|
h->vals_buf = new_vals; |
|
||||||
|
} |
|
||||||
|
^} |
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
|
||||||
|
local id = meths.buf_set_extmark(0, ns, 8, 0, {
|
||||||
|
virt_lines={{{"Grugg"}}};
|
||||||
|
virt_lines_above = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
screen:expect{grid=[[
|
||||||
|
if (h->n_buckets < new_n_buckets) { // expand |
|
||||||
|
khkey_t *new_keys = (khkey_t *)krealloc((void *)|
|
||||||
|
h->keys, new_n_buckets * sizeof(khkey_t)); |
|
||||||
|
h->keys = new_keys; |
|
||||||
|
if (kh_is_map && val_size) { |
|
||||||
|
char *new_vals = krealloc( h->vals_buf, new_n_|
|
||||||
|
buckets * val_size); |
|
||||||
|
h->vals_buf = new_vals; |
|
||||||
|
} |
|
||||||
|
^} |
|
||||||
|
Grugg |
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('dd')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
if (h->n_buckets < new_n_buckets) { // expand |
|
||||||
|
khkey_t *new_keys = (khkey_t *)krealloc((void *)|
|
||||||
|
h->keys, new_n_buckets * sizeof(khkey_t)); |
|
||||||
|
h->keys = new_keys; |
|
||||||
|
if (kh_is_map && val_size) { |
|
||||||
|
char *new_vals = krealloc( h->vals_buf, new_n_|
|
||||||
|
buckets * val_size); |
|
||||||
|
h->vals_buf = new_vals; |
|
||||||
|
^} |
|
||||||
|
Grugg |
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('dk')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
if (h->n_buckets < new_n_buckets) { // expand |
|
||||||
|
khkey_t *new_keys = (khkey_t *)krealloc((void *)|
|
||||||
|
h->keys, new_n_buckets * sizeof(khkey_t)); |
|
||||||
|
h->keys = new_keys; |
|
||||||
|
if (kh_is_map && val_size) { |
|
||||||
|
^char *new_vals = krealloc( h->vals_buf, new_n_|
|
||||||
|
buckets * val_size); |
|
||||||
|
Grugg |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('dgg')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
^ |
|
||||||
|
Grugg |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
--No lines in buffer-- |
|
||||||
|
]]}
|
||||||
|
|
||||||
|
meths.buf_del_extmark(0, ns, id)
|
||||||
|
screen:expect{grid=[[
|
||||||
|
^ |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
--No lines in buffer-- |
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
|
|
||||||
it('does not cause syntax ml_get error at the end of a buffer #17816', function()
|
it('does not cause syntax ml_get error at the end of a buffer #17816', function()
|
||||||
command([[syntax region foo keepend start='^foo' end='^$']])
|
command([[syntax region foo keepend start='^foo' end='^$']])
|
||||||
command('syntax sync minlines=100')
|
command('syntax sync minlines=100')
|
||||||
|
Reference in New Issue
Block a user