diff --git a/src/config.rs b/src/config.rs index 27ceeaf..5f34a32 100644 --- a/src/config.rs +++ b/src/config.rs @@ -104,7 +104,7 @@ impl NodeTypesConfig { node_type = node_type.extend(conf); } - if let Some(conf) = self.extension.get(&node.extension) { + if let (Some(conf), false) = (self.extension.get(&node.extension), node.is_dir) { node_type = node_type.extend(conf); } diff --git a/src/lua/util.rs b/src/lua/util.rs index 63abbe9..6d761e3 100644 --- a/src/lua/util.rs +++ b/src/lua/util.rs @@ -160,7 +160,7 @@ pub fn is_dir<'a>(util: Table<'a>, lua: &Lua) -> Result> { /// ``` pub fn is_file<'a>(util: Table<'a>, lua: &Lua) -> Result> { let func = - lua.create_function(move |_, path: String| Ok(PathBuf::from(path).is_dir()))?; + lua.create_function(move |_, path: String| Ok(PathBuf::from(path).is_file()))?; util.set("is_file", func)?; Ok(util) }