mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user