1 parent
e8e40c9704
commit
8cc90dcf33
2 files changed
+11
-11
No files matched your search
+9
-10
@@ -480,24 +480,23 @@ impl ConfigInner {
|
||||
self.generation += 1;
|
||||
|
||||
let mut watch_paths = vec![];
|
||||
if let Some(path) = file_name {
|
||||
watch_paths.push(path);
|
||||
}
|
||||
|
||||
// If we loaded a user config, publish this latest version of
|
||||
// the lua state to the LUA_PIPE. This allows a subsequent
|
||||
// call to `with_lua_config` to reference this lua context
|
||||
// even though we are (probably) resolving this from a background
|
||||
// reloading thread.
|
||||
if let Some(lua) = lua {
|
||||
ConfigInner::accumulate_watch_paths(&lua, &mut watch_paths);
|
||||
// If we loaded a user config, publish this latest version of
|
||||
// the lua state to the LUA_PIPE. This allows a subsequent
|
||||
// call to `with_lua_config` to reference this lua context
|
||||
// even though we are (probably) resolving this from a background
|
||||
// reloading thread.
|
||||
LUA_PIPE.sender.try_send(lua).ok();
|
||||
}
|
||||
|
||||
log::debug!("Reloaded configuration! generation={}", self.generation);
|
||||
self.notify();
|
||||
if self.config.automatically_reload_config {
|
||||
if watch_paths.is_empty() {
|
||||
if let Some(path) = file_name {
|
||||
watch_paths.push(path);
|
||||
}
|
||||
}
|
||||
for path in watch_paths {
|
||||
self.watch_path(path);
|
||||
}
|
||||
|
||||
+2
-1
@@ -75,7 +75,6 @@ pub fn make_lua_context(config_file: &Path) -> anyhow::Result<Lua> {
|
||||
.to_str()
|
||||
.ok_or_else(|| anyhow!("config file path is not UTF-8"))?;
|
||||
|
||||
lua.set_named_registry_value("wezterm-watch-paths", vec![config_file_str])?;
|
||||
wezterm_mod.set("config_file", config_file_str)?;
|
||||
wezterm_mod.set(
|
||||
"config_dir",
|
||||
@@ -83,6 +82,8 @@ pub fn make_lua_context(config_file: &Path) -> anyhow::Result<Lua> {
|
||||
.to_str()
|
||||
.ok_or_else(|| anyhow!("config dir path is not UTF-8"))?,
|
||||
)?;
|
||||
|
||||
lua.set_named_registry_value("wezterm-watch-paths", Vec::<String>::new())?;
|
||||
wezterm_mod.set(
|
||||
"add_to_config_reload_watch_list",
|
||||
lua.create_function(|lua, args: Variadic<String>| {
|
||||
|
||||
Reference in new issue
Block a user