mirror of
https://github.com/sayanarijit/xplr.git
synced 2024-10-27 03:11:12 +03:00
Fix node type resolution
Fix node_type for directory with extension
This commit is contained in:
parent
ad8afa9d38
commit
a48dae008c
@ -104,7 +104,7 @@ impl NodeTypesConfig {
|
|||||||
node_type = node_type.extend(conf);
|
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);
|
node_type = node_type.extend(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ pub fn is_dir<'a>(util: Table<'a>, lua: &Lua) -> Result<Table<'a>> {
|
|||||||
/// ```
|
/// ```
|
||||||
pub fn is_file<'a>(util: Table<'a>, lua: &Lua) -> Result<Table<'a>> {
|
pub fn is_file<'a>(util: Table<'a>, lua: &Lua) -> Result<Table<'a>> {
|
||||||
let func =
|
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)?;
|
util.set("is_file", func)?;
|
||||||
Ok(util)
|
Ok(util)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user