On 2019/05/21 13:17, someone replied thusly to 'J S' via vim_use wrote:
>> But is also allows the offset (and then length, too, but ignore that
>> for now) to be negative.  But, alas, as noted in "man bash", if the
>> offset is negative, you have to
>> put a space after the :, in order to avoid ambiguity with the usual
>> ${var:-xxx} construct.  So, you have to write:
>>
>> $ echo ${var: -9:5}
>>
>> Alas, vim flags this as an error.  If I take out the space before the
>> -, the highlighting is OK.  But with the space, it is flagged as error.
>>
>> Can this be fixed?
>Not that it fixes the syntax, but I've always used "${var:0-9:5}" so the field
>would clearly stand out as starting with an integer and not the ambiguous
>'dash'.  Is that flagged as an error too? 

Thank you!  Changing the space to a zero does both of these thngs:
1) Clears the VIM syntax highlighting error.
2) Does not change the bash functionality.
That zero works in bash is, of course, not mentioned in "man bash".  How did 
you figure that out?Maybe I should take it up with the bash maintainer.

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/856770722.5136208.1558863606401%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to