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

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



Peter wrote:
> > A similar issue occurs at the start of the line - element 1 contains
> > whitespace while element 3 doesn't.
>
> I'm not sure what you're testing.  I've put a test function below and
> ran it with
>
> mwbs-test -w normal-subword $'one two ThreeFour ' $' \nFiveSix seven'

I probably should have said start/end of the buffer rather than of the
line.
It is the output of the following two:
  mwbs-test '   ' '  word'
  mwbs-test 'word  ' '   '

In the latter case, this is:

      start: ''
wd-before-c: 'word'
ws-before-c: '  '
 ws-after-c: ''
 wd-after-c: ''
 ws-after-w: ''
        end: '   '

So the spaces go in end rather than ws-after-c.
Whenever the cursor is between actual words, ws-before-c and ws-after-c will
cover the full area of whitespace surrounding the cursor. I don't see
why it should be different when you've got the end/start of the buffer.
For comparison, try: mwbs-test 'word  ' '   x'

In vi word selection will grab a whole block of whitespace in these
cases.

> This should fix this in a way that makes it easy to add new features.

Thanks. Looks good to me.

> +If the option -A is given to tt(match-words-by-style), then

Given that it is the calling functions' responsibility to declare
matched_words, it could just use ${(t)matched_words} but I'm not
especially bothered.

Oliver



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