mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
38796: Fix subword matching on last character of subword.
This commit is contained in:
parent
080b1cabab
commit
c135c416b2
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2016-07-08 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 38796: Functions/Zle/match-words-by-style: fix subword
|
||||
matching on last character of subword.
|
||||
|
||||
2016-07-05 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* arno: 38780: Completion/X/Command/_setxkbmap: include
|
||||
|
|
|
@ -202,7 +202,7 @@ if [[ $wordstyle = *subword* ]]; then
|
|||
# followed by a lower case letter, or an upper case letter at
|
||||
# the start of a group of upper case letters. To make
|
||||
# it easier to be consistent, we just use anything that
|
||||
# isn't an upper case characer instead of a lower case
|
||||
# isn't an upper case character instead of a lower case
|
||||
# character.
|
||||
# Here the initial "*" will match greedily, so we get the
|
||||
# last such match, as we want.
|
||||
|
@ -237,6 +237,12 @@ if [[ $wordstyle = *subword* ]]; then
|
|||
-n $match[2] ]]; then
|
||||
# Yes, so the last one is new word boundary.
|
||||
(( epos = ${#match[1]} - 1 ))
|
||||
# Otherwise, are we in the middle of a word?
|
||||
# In other, er, words, we've got something on the left with no
|
||||
# white space following and something that doesn't start a word here.
|
||||
elif [[ -n $word1 && -z $ws1 && -z $ws2 && \
|
||||
$word2 = (#b)([^${~subwordrange}]##)* ]]; then
|
||||
(( epos = ${#match[1]} ))
|
||||
# Otherwise, do we have upper followed by non-upper not
|
||||
# at the start? Ignore the initial character, we already
|
||||
# know it's a word boundary so it can be an upper case character
|
||||
|
|
Loading…
Reference in a new issue