avim icon indicating copy to clipboard operation
avim copied to clipboard

Selectively enable/disable in Komodo based on language context

Open 1ec5 opened this issue 10 years ago • 0 comments

Some programming languages only allow non-ASCII characters in certain places. For example, Vietnamese text is allowed in JSON strings but nowhere else in JSON, while HTML allows it almost anywhere, even data- attribute names. In Komodo IDE and Komodo Edit, AVIM should work where Vietnamese is syntactically allowed but should stay out of the way where it isn’t. This is especially important with VIQR, which relies on punctuation such as . and ' that carries special meaning in many programming languages.

Among other things, the Komodo macro API can say the current language. Not sure whether it can say whether the current selection is in a string or comment, but that would be swell.

One problem to contend with is that it may not always be obvious to the user when or why AVIM is magically enabled or disabled. Even if the rules are clear, the user may be accustomed to escaping dead keys themselves when typing identifiers and such. To avoid breaking muscle memory, this feature should either be quite limited in scope or be configurable in a preference pane, off by default.

Vietnamese would probably occur most frequently throughout markup languages such as HTML and Markdown, as well as in strings and comments in scripting languages such as JavaScript, PHP, and Lua. Beyond just enabling and disabling based on context, AVIM could know to split word boundaries within camel case words, since they’re very common in programming. That would increase the likelihood that a user writing for a Vietnamese audience might use Vietnamese for identifiers as well.

1ec5 avatar Apr 01 '15 09:04 1ec5