Scroll to follow expanding part of editor::SelectLargerSyntaxNode
(#27295)
When the selection grows both ways, the new code prioritizes the top part instead of bottom one, this is usually more helpful considering that most programming language grammars tend to define tokens right before large delimited blocks, and rarely after (because humans and parsers read from top to bottom). Also, revert selection when convenient, so you have more control over what you're selecting, looking at the selection `head` is commonly more convenient than at the `tail`. Release Notes: - Improve scrolling of `editor::SelectLargerSyntaxNode` for better visibility.
This commit is contained in:
parent
fa677bdc38
commit
9918b6cade
5 changed files with 194 additions and 114 deletions
|
@ -6033,7 +6033,7 @@ async fn test_select_larger_smaller_syntax_node(cx: &mut TestAppContext) {
|
|||
use mod1::mod2::{mod3, «mod4ˇ»};
|
||||
|
||||
fn fn_1«ˇ(param1: bool, param2: &str)» {
|
||||
let var1 = "«textˇ»";
|
||||
let var1 = "«ˇtext»";
|
||||
}
|
||||
"#},
|
||||
cx,
|
||||
|
@ -6101,7 +6101,7 @@ async fn test_select_larger_smaller_syntax_node(cx: &mut TestAppContext) {
|
|||
use mod1::mod2::{mod3, «mod4ˇ»};
|
||||
|
||||
fn fn_1«ˇ(param1: bool, param2: &str)» {
|
||||
let var1 = "«textˇ»";
|
||||
let var1 = "«ˇtext»";
|
||||
}
|
||||
"#},
|
||||
cx,
|
||||
|
@ -6170,7 +6170,7 @@ async fn test_select_larger_smaller_syntax_node(cx: &mut TestAppContext) {
|
|||
use mod1::mod2::«{mod3, mod4}ˇ»;
|
||||
|
||||
fn fn_1«ˇ(param1: bool, param2: &str)» {
|
||||
«let var1 = "text";ˇ»
|
||||
«ˇlet var1 = "text";»
|
||||
}
|
||||
"#},
|
||||
cx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue