Skip to content

Commit

Permalink
optimize: SelectCurrentWord
Browse files Browse the repository at this point in the history
  • Loading branch information
no5ix committed Dec 24, 2021
1 parent 5cb5d45 commit fb53ea2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/action.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,11 @@ SelectCurrentWord() {
Sleep, 66
st := GetCurSelectedText()
first_char := SubStr(st, 1, 1)
if (!RegExMatch(first_char, "[a-zA-Z]") && !RegExMatch(first_char, "[\u4e00-\u9fa5]")) {
if (!RegExMatch(first_char, "[0-9a-zA-Z]") && !RegExMatch(first_char, "[^\x00-\xff]") && first_char != "_") {
send, {Right}
}
else {
send, {Right} ; 没有这一句的话, 如果初始光标在当前word的第二个字符后面的时候会有问题
send, ^{Left}
}
sleep, 66
Expand Down

0 comments on commit fb53ea2

Please sign in to comment.