aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2026-05-11 21:54:55 +0200
committerGitHub <noreply@github.com>2026-05-11 15:54:55 -0400
commit96fc7c150f0db6f7eaed3fc4e731210d64581eb8 (patch)
treea49bcf88f57f2464bb64adab46070a56d0b17202 /src/nvim/api/buffer.c
parentce9f4f036918f541c0c66a99b2c3b6f0fce0c6c9 (diff)
downloadrneovim-96fc7c150f0db6f7eaed3fc4e731210d64581eb8.tar.gz
rneovim-96fc7c150f0db6f7eaed3fc4e731210d64581eb8.tar.bz2
rneovim-96fc7c150f0db6f7eaed3fc4e731210d64581eb8.zip
fix(api): don't update 'title' when renaming non-curbuf #39743
Problem: 'title' is updated when changing the name of a non-current buffer with nvim_buf_set_name(). Solution: Set RedrawingDisabled when renaming the buffer.
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 28f30030d5..e62fd0e401 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -965,7 +965,8 @@ void nvim_buf_set_name(Buffer buf, String name, Error *err)
const bool is_curbuf = b == curbuf;
const int save_acd = p_acd;
if (!is_curbuf) {
- // Temporarily disable 'autochdir' when setting file name for another buffer.
+ // Don't update 'title' and 'autochdir' when setting file name for another buffer.
+ RedrawingDisabled++;
p_acd = false;
}
@@ -976,6 +977,7 @@ void nvim_buf_set_name(Buffer buf, String name, Error *err)
aucmd_restbuf(&aco);
if (!is_curbuf) {
+ RedrawingDisabled--;
p_acd = save_acd;
}
});