mirror of https://github.com/lapce/lapce.git
Merge pull request #905 from rtsuk/toggle-inline-hints
Add command to toggle inlay hints
This commit is contained in:
commit
28d049c975
|
@ -397,6 +397,10 @@ pub enum LapceWorkbenchCommand {
|
|||
#[strum(serialize = "previous_editor_tab")]
|
||||
#[strum(message = "Previous editor tab")]
|
||||
PreviousEditorTab,
|
||||
|
||||
#[strum(serialize = "toggle_inlay_hints")]
|
||||
#[strum(message = "Toggle Inlay Hints")]
|
||||
ToggleInlayHints,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
@ -1456,6 +1456,15 @@ pub fn run_workbench_command(
|
|||
));
|
||||
}
|
||||
}
|
||||
LapceWorkbenchCommand::ToggleInlayHints => {
|
||||
let config = Arc::make_mut(&mut self.config);
|
||||
config.editor.enable_inlay_hints = !config.editor.enable_inlay_hints;
|
||||
Config::update_file(
|
||||
"editor",
|
||||
"enable-inlay-hints",
|
||||
toml::Value::Boolean(config.editor.enable_inlay_hints),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue