ow-- / vscode-subword-navigation

Provides subword navigation for Visual Studio Code.
MIT License
51 stars 10 forks source link

Behaviour when navigating acronyms #2

Closed massimocode closed 8 years ago

massimocode commented 8 years ago

Hi

Great work on this. I really like it!

However, there's one small thing that I think could be improved.

Consider something like TextParserHTML

If you subword delete right with the cursor at Text ^ ParserHTML then it correctly deletes the word Parser

But if you subword delete right with the cursor at TextParser ^ HTML then it only deletes the H, not the whole HTML.

I think it would be better if it deleted everything until the end, or everything until the last capital letter if there was another word after the acronym.

Like for example My ^ HTMLParser would delete HTML and not P because P was followed by lowercase letters.

That would be awesome!

ow-- commented 8 years ago

This did uncover a bug in where delete right with TextParser ^ HTML and a trailing space results in TextParserL. And conversely it also happens when simply jumping.

However, I can't manage to repro what you describe at the moment. It just seems to behave like you want it to. Which certainly was the intention.

Could it be some circumstance that I didn't foresee at all? Something with encoding, character sets? A very special combo of whitespace/newline/something else surrounding it? Wait, could it actually behave differently on OSX/Linux? What do you run?

I don't know. I need more help. :blush:

massimocode commented 8 years ago

Hey Olle

Thanks for getting back to me. I will have to give it a try at work tomorrow and get back to you to let you know the exact behaviour and environment details.

Thanks!

massimocode commented 8 years ago

I just checked this and the behaviour is exactly as you describe. I can't replicate my original issue, but I can replicate the bug you mention with the trailing space.

I have to admit that shortly after I posted this issue I noticed my keyboard shortcut for deleting right was not set up correctly! I should have retested and updated the issue but forgot to. Sorry about that! I'm happy that the issue was of some use though (trailing space).

For the record I'm (regretfully) using OSX and the encoding is good old UTF-8.

massimocode commented 8 years ago

I have managed to replicate behaviour very similar to my original issue.

Type in 'HELLO' and then put the cursor at the end of the word (but before the closing quotes) and do subword delete left and it only deletes O, not the whole word.

I hope this helps!

ow-- commented 8 years ago

Alright, I think I got it. Hopefully I didn't break anything too bad in the process, I changed up the boundary classification a fair bit. I should really get on a suite of test cases some day.

Thanks for taking the time! Just reopen this or whatever you do if you find anything more.