aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-10 08:54:37 +0800
committerGitHub <noreply@github.com>2022-05-10 08:54:37 +0800
commit5359be78935dc639c481d74f010fe133dd40290c (patch)
tree84c02f5a532d200cfa6b122b70ef625bc5c99068 /src/nvim/buffer.c
parent9aa5647e686e5420e5b9b51828ec7d55631f98ed (diff)
parent65df08aade7eac9fab51058924af89a60351f4bf (diff)
downloadrneovim-5359be78935dc639c481d74f010fe133dd40290c.tar.gz
rneovim-5359be78935dc639c481d74f010fe133dd40290c.tar.bz2
rneovim-5359be78935dc639c481d74f010fe133dd40290c.zip
Merge pull request #18509 from zeertzjq/vim-8.2.4929
vim-patch:8.2.4929: off-by-one error in in statusline item
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 8a56a08aaa..ab804cc42f 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3635,7 +3635,8 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san
// correct the start of the items for the truncation
for (int idx = stl_groupitems[groupdepth] + 1; idx < curitem; idx++) {
// Shift everything back by the number of removed bytes
- stl_items[idx].start -= n;
+ // Minus one for the leading '<' added above.
+ stl_items[idx].start -= n - 1;
// If the item was partially or completely truncated, set its
// start to the start of the group