Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug with camel case and delete-whole-word-match function



On Tue, 05 Jul 2016 09:12:01 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> On Jul 5, 11:19am, Peter Stephenson wrote:
> } Subject: Re: bug with camel case and delete-whole-word-match function
> }
> } However, if you're on the "S", you get "Is" before and "Some" after.
> } Again there's no white space, so there's nothing to indicate to the
> } calling function that these are two separate words rather than bits of
> } the same word.
> 
> Maybe I'm missing something, but shouldn't every capital letter be
> treated as the start of a word in this situation, even if it's under
> the cursor?

Yes, that's what happens.  But the caller doesn't know the difference
between this and getting "Som" and "e" where there's *no* start-of-word
under the cursor, just parts of the word before and on/after.  With
standard word matching it can tell by looking at white space, here it
could only tell by checking again if it's *really* a start of word.
That additional check is the issue.

Because, in normal cases, (word-bit-before '' '' word-bit-after) always
indicates two parts of the same word, the caller will naturally assume
that here unless it has the extra test.  Hence it's the "Is" "Some" that
behaves incorrectly, rather than the "Som" "e".

pws



Messages sorted by: Reverse Date, Date, Thread, Author