mirror of
https://github.com/alacritty/alacritty.git
synced 2025-04-21 18:02:37 -04:00
Fix default URL binding
The default binding for launching the URL hints was documented as Ctrl+Shift+U, but never actually set. This adds this binding as the default instead of having URLs only launchable using the mouse.
This commit is contained in:
parent
d0ab81bf3f
commit
939b0c548a
2 changed files with 16 additions and 8 deletions
|
@ -118,8 +118,7 @@ pub fn load(options: &Options) -> Config {
|
|||
config
|
||||
});
|
||||
|
||||
// Override config with CLI options.
|
||||
options.override_config(&mut config);
|
||||
after_loading(&mut config, options);
|
||||
|
||||
config
|
||||
}
|
||||
|
@ -130,12 +129,20 @@ pub fn reload(config_path: &Path, options: &Options) -> Result<Config> {
|
|||
let config_options = options.config_options().clone();
|
||||
let mut config = load_from(config_path, config_options)?;
|
||||
|
||||
// Override config with CLI options.
|
||||
options.override_config(&mut config);
|
||||
after_loading(&mut config, options);
|
||||
|
||||
Ok(config)
|
||||
}
|
||||
|
||||
/// Modifications after the `Config` object is created.
|
||||
fn after_loading(config: &mut Config, options: &Options) {
|
||||
// Override config with CLI options.
|
||||
options.override_config(config);
|
||||
|
||||
// Create key bindings for regex hints.
|
||||
config.ui_config.generate_hint_bindings();
|
||||
}
|
||||
|
||||
/// Load configuration file and log errors.
|
||||
fn load_from(path: &Path, cli_config: Value) -> Result<Config> {
|
||||
match read_config(path, cli_config) {
|
||||
|
@ -159,9 +166,6 @@ fn read_config(path: &Path, cli_config: Value) -> Result<Config> {
|
|||
let mut config = Config::deserialize(config_value)?;
|
||||
config.ui_config.config_paths = config_paths;
|
||||
|
||||
// Create key bindings for regex hints.
|
||||
config.ui_config.generate_hint_bindings();
|
||||
|
||||
Ok(config)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ use std::cell::RefCell;
|
|||
use std::path::PathBuf;
|
||||
use std::rc::Rc;
|
||||
|
||||
use glutin::event::{ModifiersState, VirtualKeyCode};
|
||||
use log::error;
|
||||
use serde::de::Error as SerdeError;
|
||||
use serde::{self, Deserialize, Deserializer};
|
||||
|
@ -238,7 +239,10 @@ impl Default for Hints {
|
|||
action,
|
||||
post_processing: true,
|
||||
mouse: Some(HintMouse { enabled: true, mods: Default::default() }),
|
||||
binding: Default::default(),
|
||||
binding: Some(HintBinding {
|
||||
key: Key::Keycode(VirtualKeyCode::U),
|
||||
mods: ModsWrapper(ModifiersState::SHIFT | ModifiersState::CTRL),
|
||||
}),
|
||||
}],
|
||||
alphabet: Default::default(),
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue