mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
feat(ui): add chdir UI event (#27093)
When an embedded Nvim instance changes its current directory a "chdir" UI event is emitted. Attached UIs can use this information however they wish. In the TUI it is used to synchronize the cwd of the TUI process with the cwd of the embedded Nvim process.
This commit is contained in:
@@ -384,6 +384,12 @@ void ui_attach_impl(UI *ui, uint64_t chanid)
|
||||
ui_refresh_options();
|
||||
resettitle();
|
||||
|
||||
char cwd[MAXPATHL];
|
||||
size_t cwdlen = sizeof(cwd);
|
||||
if (uv_cwd(cwd, &cwdlen) == 0) {
|
||||
ui_call_chdir((String){ .data = cwd, .size = cwdlen });
|
||||
}
|
||||
|
||||
for (UIExtension i = kUIGlobalCount; (int)i < kUIExtCount; i++) {
|
||||
ui_set_ext_option(ui, i, ui->ui_ext[i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user