atg / chocolat-public

Public bug tracker for the private chocolat project
http://chocolatapp.com
182 stars 4 forks source link

Keyboard text selection differs from OSX default behaviour #1749

Open nathanuphoff opened 8 years ago

nathanuphoff commented 8 years ago

Hi there,

One of the primary reasons I use Chocolat is the native feel within OS X. With text selection via the keyboard however, the behaviour differs from it’s native OS X counterpart. Namely when using alt, shift, arrow to select a dashed word or text.

I-should-be-able-to-cycle-through-each-word-in-this-rule with the shortcut mentioned yet in Chocolat the whole rule gets selected. Dito for cursor navigation which skips from the start to the end. Dashed should be treated as a space per OS X behaviour, which would be great to see in a future update.

I made a screen recording to show the behaviour in pages differ from Chocolat (1MB .mov file): http://cl.ly/dqDR (note it should say alt instead of cmd).

Edit: the same goes for dots which makes renaming in the sidebar awkward compared to doing so in Finder.

Chocolat v3.1.7

Cheers.

atg commented 8 years ago

Yes, that is not expected.

In some languages it is desirable for dashes to be included in what is a "word". for instance in HTML you want the foo-bar in class="foo-bar" to be one word. Same in lisp where hyphenated identifiers are often used.

As a workaround you can use ctrl-shift-[left/right].

atg commented 8 years ago

Yeah the problem is that -[CHFullTextView wordsCharacterSet] does not use CHWordCharacterStringForScope(), so it's just doing a very simplistic "@$-_".

I've decided to revert to the system behaviour, since it is more important to have correct word movement in (possibly non-alphabetic) comments, rather than correct movement in code.

If editing code becomes too annoying, I'll add it back for certain languages.

atg commented 8 years ago

Although it is very annoying that the system behaviour is to treat "foo.bar" as one word.