aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2026-05-21 09:35:27 +0800
committerGitHub <noreply@github.com>2026-05-21 09:35:27 +0800
commita952575c3bb8e23cccaaeb91bc5cc0cb908cb02c (patch)
tree5f5721d25dccc5b11ece3edb29f1ecca50831f9c /src/nvim/buffer.c
parent74cc0364f1706ae8df84f1750251b6a0dd3e43fd (diff)
downloadrneovim-a952575c3bb8e23cccaaeb91bc5cc0cb908cb02c.tar.gz
rneovim-a952575c3bb8e23cccaaeb91bc5cc0cb908cb02c.tar.bz2
rneovim-a952575c3bb8e23cccaaeb91bc5cc0cb908cb02c.zip
vim-patch:9.2.0506: home_replace() function can be improved (#39925)
Problem: home_replace() function can be improved Solution: Refactor home_replace() to return the length of the string (John Marriott). In addition: - in function set_b0_fname() move ulen into the block where it is used. - In function findswapname() rework logic around displaying "swap file already exists" dialogue so that literal message text is set once. closes: vim/vim#20249 https://github.com/vim/vim/commit/a0931a90eeee6692556f330b5ba1fb413f9ea85d Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 5ef7cda17a..09993d03de 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3317,9 +3317,8 @@ void fileinfo(int fullname, int shorthelp, bool dont_truncate)
IOSIZE - bufferlen, "%s", name);
} else {
name = (!fullname && curbuf->b_fname != NULL) ? curbuf->b_fname : curbuf->b_ffname;
- home_replace(shorthelp ? curbuf : NULL, name, buffer + bufferlen,
- IOSIZE - bufferlen, true);
- bufferlen += strlen(buffer + bufferlen);
+ bufferlen += home_replace(shorthelp ? curbuf : NULL, name,
+ buffer + bufferlen, IOSIZE - bufferlen, true);
}
bool dontwrite = bt_dontwrite(curbuf);