aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2024-01-19 14:51:10 -0600
committerGitHub <noreply@github.com>2024-01-19 14:51:10 -0600
commitd3a8e9217f39c59dd7762bd22a76b8bd03ca85ff (patch)
tree176bbcf0793bab5338614f717f003c385f9c3878 /src/nvim/tui
parent5a8fe0769cc9c5d8323b073d5c45ee37ce91c049 (diff)
downloadrneovim-d3a8e9217f39c59dd7762bd22a76b8bd03ca85ff.tar.gz
rneovim-d3a8e9217f39c59dd7762bd22a76b8bd03ca85ff.tar.bz2
rneovim-d3a8e9217f39c59dd7762bd22a76b8bd03ca85ff.zip
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.
Diffstat (limited to 'src/nvim/tui')
-rw-r--r--src/nvim/tui/tui.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 6b8b73a2a0..f9560ce076 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -1500,6 +1500,14 @@ void tui_option_set(TUIData *tui, String name, Object value)
}
}
+void tui_chdir(TUIData *tui, String path)
+{
+ int err = uv_chdir(path.data);
+ if (err != 0) {
+ ELOG("Failed to chdir to %s: %s", path.data, strerror(err));
+ }
+}
+
void tui_raw_line(TUIData *tui, Integer g, Integer linerow, Integer startcol, Integer endcol,
Integer clearcol, Integer clearattr, LineFlags flags, const schar_T *chunk,
const sattr_T *attrs)