mirror of
https://github.com/neovim/neovim.git
synced 2026-06-17 17:21:16 +00:00
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
a0931a90ee
Co-authored-by: John Marriott <basilisk@internode.on.net>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user