aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-25 21:38:46 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-09-25 21:44:01 +0800
commitfded344f38f0814256b3acd01d94d5942a22f7fc (patch)
treeeffc3fdc8c7fc7ba1c701be7f6e9f61358700d21
parent91e912f8d40284c74d4a997c8c95961eebb35d91 (diff)
downloadrneovim-fded344f38f0814256b3acd01d94d5942a22f7fc.tar.gz
rneovim-fded344f38f0814256b3acd01d94d5942a22f7fc.tar.bz2
rneovim-fded344f38f0814256b3acd01d94d5942a22f7fc.zip
fix(extmarks): make virt_lines always start at 0 virtcol
-rw-r--r--src/nvim/drawline.c2
-rw-r--r--test/functional/ui/decorations_spec.lua32
2 files changed, 33 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 5c3fa3d3b0..10e1d95730 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -2607,7 +2607,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
assert(i >= 0);
int offset = kv_A(virt_lines, i).left_col ? 0 : win_col_offset;
draw_virt_text_item(buf, offset, kv_A(virt_lines, i).line,
- kHlModeReplace, grid->cols, offset);
+ kHlModeReplace, grid->cols, 0);
}
} else {
draw_virt_text(wp, buf, win_col_offset, &draw_col, grid->cols, row);
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index eff6fe6d23..44b88d702f 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1550,6 +1550,38 @@ if (h->n_buckets < new_n_buckets) { // expand
} |
|
]]}
+
+ command 'set number'
+ screen:expect{grid=[[
+ {9: 1 }^if (h->n_buckets < new_n_buckets) { // expand |
+ {9: 2 } khkey_t *new_keys = (khkey_t *)krealloc((voi|
+ {9: }d *)h->keys, new_n_buckets * sizeof(khkey_t));|
+ {9: }{1:>>}{2: very tabby}text with tabs |
+ {9: 3 } h->keys = new_keys; |
+ {9: 4 } if (kh_is_map && val_size) { |
+ {9: 5 } char *new_vals = krealloc( h->vals_buf, ne|
+ {9: }w_n_buckets * val_size); |
+ {9: 6 } h->vals_buf = new_vals; |
+ {9: 7 } } |
+ {9: 8 }} |
+ |
+ ]]}
+
+ command 'set tabstop&'
+ screen:expect{grid=[[
+ {9: 1 }^if (h->n_buckets < new_n_buckets) { // expand |
+ {9: 2 } khkey_t *new_keys = (khkey_t *)krealloc((voi|
+ {9: }d *)h->keys, new_n_buckets * sizeof(khkey_t));|
+ {9: }{1:>>}{2: very tabby}text with tabs |
+ {9: 3 } h->keys = new_keys; |
+ {9: 4 } if (kh_is_map && val_size) { |
+ {9: 5 } char *new_vals = krealloc( h->vals_buf, ne|
+ {9: }w_n_buckets * val_size); |
+ {9: 6 } h->vals_buf = new_vals; |
+ {9: 7 } } |
+ {9: 8 }} |
+ |
+ ]]}
end)
end)