ul / kak-tree

Structural selections for Kakoune
The Unlicense
100 stars 10 forks source link

Don't crash if we filter out all selections. #1

Closed Screwtapello closed 5 years ago

Screwtapello commented 5 years ago

While tinkering with the "select children" logic, I discovered that if you remove all selections, Kakoune gets cross. Let's display the traditional error-message in that case.

Screwtapello commented 5 years ago

Actually, I'm not sure if this should be fail or echo -markup {Error}. fail is consistent with other Kakoune selection-modifying commands, but it does break my locked user-mode when I invoke tree-select-children too many times.

Maybe my user-mode should just execute

: try %{ tree-select-children } catch %{ echo -markup {Error}no children }<ret>

...to eat the error.

ul commented 5 years ago

Woohoo! Thanks for all those PRs =)