Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.16k stars 303 forks source link

Show empty tabstops #2166

Open Defman21 opened 7 years ago

Defman21 commented 7 years ago

Short Summary

Komodo allows you to use empty tabstops in your snippets ([[%tabstop:]]), but they are invisible in the editor itself. Even a 2px box would be very appreciated.

Platform Information

Komodo Edit or IDE? IDE Komodo Version? 10.1

mitchell-as commented 7 years ago

This one is tricky, because you cannot put a border around a zero-width entity. We'd have to temporarily insert a single space in order to display a border and then remove it upon visiting the tab stop. Since snippets can define a single-space tab stop, we'd have to keep track of which tab stops need their space removed. As you can see it gets quite messy. I don't think the amount of work needed justifies the cosmetic result.

@Naatan if you disagree, re-open and assign to me.

Naatan commented 7 years ago

I don't see it being that messy or complicated, eg. if you have 10 tabstops and the third and 5th need a space, you simply store that number somewhere and as tabstops are completely sequential trigger the additional logic as the user goes through them. Maybe I'm missing something though?

mitchell-as commented 7 years ago

Tabstops can be numbered, appear non-sequentially, and be numbered the same, so you cannot assume that marking the "3rd" and "5th" tabstop is sufficient. There's also the issue of tabstops numbered the same, but one of them is empty and the other is not (a common case). Therefore each tabstop needs an individual identifier for proper handling. I've worked with something similar before, and it's not trivial -- especially if this kind of thing was not taken into account in the design. (That is, starting over can be better than wedging these ideas into an existing design.)

Naatan commented 7 years ago

After talking it over with @mitchell-as in Slack; we'll resolve this by adding a special character (tbd) in places where there is an empty tabstop, this character will then be stripped when iterating over the tabstop or when escaping out of the completions.

Naatan commented 7 years ago

Some candidates:

U+2013 U+2014 U+2015 U+00A6
U+00B0