Open alexherbo2 opened 7 years ago
Not really related but I managed to get around this meaningful selection pattern in JavaScript with the following plugin: https://github.com/Delapouite/kakoune-grasp
For example for lambdas you can use grasp s arrow
, or be more precise with grasp s arrow.body
or grasp s arrow.params
Not really what was asked here, but matching characters are now controlled by the matching_pairs
option, so javascript.kak could tweak this not to treat <
and >
as matching pairs.
There's more broken case (█
is a cursor):
█
(
case ${var} in
a) echo "a!" ;;
*) ;;
esac
) > ${file}
Pressing m on the first opening (
will bring us to correct file position, but not semantically correct code point:
[(
case ${var} in
a)] echo "a!" ;;
*) ;;
esac
) > ${file}
Semantically correct selection would be:
[(
case ${var} in
a) echo "a!" ;;
*) ;;
esac
)] > ${file}
Also, broken Rust example:
fn main() {
if a < b {
println!("a");
}
}
fn some_function(a: i32)█-> i32 {
a
}
pressing m will result into:
fn main() {
if a [< b {
println!("a");
}
}
fn some_function(a: i32) ->] i32 {
a
}
instead of semantically correct:
fn main() {
if a < b {
println!("a");
}
}
fn some_function(a: i32) -> i32 [{
a
}]
Though this case could be handled by adjusting matching_pairs
Example:
Skipping non matching characters (
>
) would allow to select{ … }
block on declaration.