Minor changes

pull/560/head
Arijit Basu 1 year ago
parent 0715e242ef
commit 1d9d5f5145
No known key found for this signature in database
GPG Key ID: 0F8EF5258DC38077

@ -19,7 +19,7 @@ of the following plugins work for you, it's very easy to
- [**dtomvan/term.xplr**][39] Terminal integration for xplr
- [**sayanarijit/wl-clipboard.xplr**][52] Copy and paste with system clipboard using wl-clipboard
- [**dtomvan/xpm.xplr**][47] The XPLR Plugin Manager
- [**emsquid/style.xplr**][57] Helper plugin that allows you to integrate xplr's [Style][58] anywhere
- [**emsquid/style.xplr**][57] Helper plugin that allows you to integrate xplr's [Style][58] anywhere
### Integration

@ -131,5 +131,4 @@ return {
{ LogSuccess = "Switched layout" },
{ CallLuaSilently = "custom.some_plugin_with_hooks.on_layout_switch" },
}
}
```

@ -1106,20 +1106,10 @@ impl App {
}
fn switch_mode_keeping_input_buffer(mut self, mode: &str) -> Result<Self> {
if let Some(mode) = self.config.modes.get(mode).cloned() {
self = self.push_mode();
self.mode = mode.sanitized(
self.config.general.read_only,
self.config.general.global_key_bindings.to_owned(),
);
// Hooks
if !self.hooks.on_mode_switch.is_empty() {
let msgs = self.hooks.on_mode_switch.clone();
self = self.handle_batch_external_msgs(msgs)?
}
Ok(self)
if self.config.modes.builtin.contains_key(mode) {
self.switch_mode_builtin(mode)
} else if self.config.modes.custom.contains_key(mode) {
self.switch_mode_custom(mode)
} else {
self.log_error(format!("Mode not found: {}", mode))
}
@ -1176,16 +1166,10 @@ impl App {
}
fn switch_layout(mut self, layout: &str) -> Result<Self> {
if let Some(l) = self.config.layouts.get(layout) {
self.layout = l.to_owned();
// Hooks
if !self.hooks.on_layout_switch.is_empty() {
let msgs = self.hooks.on_layout_switch.clone();
self = self.handle_batch_external_msgs(msgs)?
}
Ok(self)
if self.config.layouts.builtin.contains_key(layout) {
self.switch_layout_builtin(layout)
} else if self.config.layouts.custom.contains_key(layout) {
self.switch_layout_custom(layout)
} else {
self.log_error(format!("Layout not found: {}", layout))
}

@ -537,12 +537,6 @@ pub struct ModesConfig {
pub custom: HashMap<String, Mode>,
}
impl ModesConfig {
pub fn get(&self, name: &str) -> Option<&Mode> {
self.builtin.get(name).or_else(|| self.custom.get(name))
}
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct PanelUiConfig {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save