Add support for auto surround (#13217)
 In the past, Zed used a single switch called `autoclose` to control both `autoclose` and `auto_surround` functionalities: + `autoclose`: when input '(', append ')' automatically. + `auto_surround`: when select text and input '(', surround text with '(' and ')' automatically. This PR separates `auto_surround` from `autoclose` to support `<`. Previously, if `autoclose` of `<` was set to `false`, `auto_surround` couldn't be used. However, setting `autoclose` to `true` would affect the default behavior of simple expression. For example, `a < b` would become `a <> b`. For more information, see #13187. Fix #12898. Release Notes: - Added support for `auto_surround` ([#12898](https://github.com/zed-industries/zed/issues/12898)).
This commit is contained in:
parent
963b0c010a
commit
95b06097ee
9 changed files with 96 additions and 6 deletions
|
@ -1782,12 +1782,14 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) {
|
|||
start: "{".into(),
|
||||
end: "}".into(),
|
||||
close: true,
|
||||
surround: true,
|
||||
newline: false,
|
||||
},
|
||||
BracketPair {
|
||||
start: "'".into(),
|
||||
end: "'".into(),
|
||||
close: true,
|
||||
surround: true,
|
||||
newline: false,
|
||||
},
|
||||
],
|
||||
|
@ -1910,12 +1912,14 @@ fn test_language_scope_at_with_rust(cx: &mut AppContext) {
|
|||
start: "{".into(),
|
||||
end: "}".into(),
|
||||
close: true,
|
||||
surround: true,
|
||||
newline: false,
|
||||
},
|
||||
BracketPair {
|
||||
start: "'".into(),
|
||||
end: "'".into(),
|
||||
close: true,
|
||||
surround: true,
|
||||
newline: false,
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue