From b1c4b22b4d3968ccda6629355a826d80547e26c9 Mon Sep 17 00:00:00 2001 From: no5ix Date: Mon, 15 Nov 2021 23:36:57 +0800 Subject: [PATCH] add select current word --- source/action.ahk | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/source/action.ahk b/source/action.ahk index 463b5ba..7959756 100644 --- a/source/action.ahk +++ b/source/action.ahk @@ -116,7 +116,7 @@ GotoPreDesktop() { } RefreshTab() { - send {F5} + send, {F5} } ReopenLastTab() { @@ -369,7 +369,21 @@ ScreenShotAndSuspend() { SwapWinCtrlShiftAlt() { TrayMenu.SetSwapWinCtrlShiftAlt() - TrayMenu.update_tray_menu()() + TrayMenu.update_tray_menu() +} + +SelectCurrentWord() { + send, ^{Right} + Sleep, 66 + send, ^+{Left} + Sleep, 66 + st := GetCurSelectedText() + first_char := SubStr(st, 0, 1) + if (!RegExMatch(first_char, "[a-zA-Z]") && !RegExMatch(first_char, "[\u4e00-\u9fa5]")) { + send, {Left} + sleep, 66 + send, ^+{Right} + } }