moodymudskipper / tricks

An Addin to Easily Program and Trigger Actions
14 stars 1 forks source link

target = "call" , target = "symbol" ? #17

Open moodymudskipper opened 2 years ago

moodymudskipper commented 2 years ago

So we don't have to select completely.

F1 works when we select a full symbol OR when the cursor's on it. These should work the same, e.g. selection_is_symbol(target = "symbol") should return TRUE if the cursor is on a symbol OR if a symbol is fully selected, I think it should return FALSE also if a symbol is partially selected.

In this case target = "symbol" should become the default.

for target = "call" we need to delimit the call by moving the cursor to the left until we have a syntactic expression on the right, and consider this expression. Corner case (showing | as the cursor) : bar(foo(test = |baz())) should not return (test = |baz()) but foo(test = |baz()).

Should infix ops be considered as function calls ? What do we do with bar(foo(test = 1 + | 1)) by default ? is it overkill to add control over this detail ?

I think first we skip all infixes including of the form %infix%, except if explicitly selected.