On Sep 26, 2005, at 11:14 PM, Allan Odgaard wrote:
2: Selections carry the scope of the last character selected. [...] I'm not sure if this one is really the wrong behavior or what. It seems logical to pick up the scope of the last character selected. I can't really think of any other way of handling that.
I've had some “concerns” about this myself. I think in most situations when the entire scope of something is selected, the current scope should really not include what's exclusive for the selected text, since with a selection, we perform an operation _on_ the selection, and that is done in the context of being “outside” it.
For example if we select <?php … ?> in HTML and use Toggle Comment, we want it to be commented as HTML, not PHP.
I am however also unsure how to “solve” it. One heuristic could be to look at the scope before and after the selection, and if these are identical, use that. So when we select something entirely, the scope excludes what's special for the stuff we selected. But if OTOH we select a partial string (or similar), the scope will include string.
Ok, this doesn't seem to be working out in real life.
i've got some html like this: <b>text</b> the scope for the 'text' when selecting the entire word is coming up as 'declaration.tag.html' also: <tag attribute="Value" attribute="Value" attribute="Value" /> the scope for the ' attribute="Value"' in the middle when selecting from the whitespace to the last quote is coming up as 'string.quoted.double'
we've solved 1 problem and created another. oi.
I don't know what the right logic should be.