Add selection_word_boundary configuration option

refs: https://github.com/wez/wezterm/issues/405
This commit is contained in:
Wez Furlong committed 2020-12-28 14:13:25 -08:00
1 parent 94ca16d987
commit da55e12b5e
3 files changed
+9 -5

No files matched your search

+7
View File
@@ -842,6 +842,13 @@ pub struct Config {
#[serde(default)]
pub native_macos_fullscreen_mode: bool,
#[serde(default = "default_word_boundary")]
pub selection_word_boundary: String,
}
fn default_word_boundary() -> String {
" \t\n{[}]()\"'".to_string()
}
fn default_one_point_oh_f64() -> f64 {
+1
View File
@@ -36,6 +36,7 @@ brief notes about them may accumulate here.
* X11: fix an issue where keys that produce unicode characters retained SHIFT as a modifier instead of normalizing it away. [#394](https://github.com/wez/wezterm/issues/394)
* Fixed an issue where a symbol-only font would be seen as 0-width and panic wezterm [#404](https://github.com/wez/wezterm/issues/404)
* Tweaked mouse selection: we now round the x-coordinate to the nearest cell which makes it a bit more forgiving if the mouse cursor is slightly to the left of the intended cell start. [#350](https://github.com/wez/wezterm/issues/350)
* Added `selection_word_boundary` option to control double-click word selection boundaries. The default is ` \t\n{[}]()\"'`. [#405](https://github.com/wez/wezterm/issues/405)
### 20201101-103216-403d002d
+1 -5
View File
@@ -51,13 +51,9 @@ pub struct SelectionRange {
pub end: SelectionCoordinate,
}
// TODO: expose is_double_click_word in config file
fn is_double_click_word(s: &str) -> bool {
match s.len() {
1 => match s.chars().nth(0).unwrap() {
' ' | '\t' | '\n' | '{' | '[' | '}' | ']' | '(' | ')' | '"' | '\'' => false,
_ => true,
},
1 => !config::configuration().selection_word_boundary.contains(s),
0 => false,
_ => true,
}