Skip to content

Commit 4473800

Browse files
committed
feat: Remove VimCheckChr from the configuration (always enable CheckChr)
feat: move end of the word correctly even if the cursor is in the word by `e` in normal mode
1 parent c00d300 commit 4473800

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ All of these can be changed from the setting menu, too.
135135
|VimSendCtrlBracketNormal|If 1, short press Ctrl-[ send Ctrl-[ in the normal mode.|0|
136136
|VimLongCtrlBracketNormal|If 1, short press and long press of Ctrl-[ behaviors are swapped.|0|
137137
|VimChangeCaretWidth|If 1, check the character under the cursor before an action. Currently this is used for: `a` in the normal mode (check if the cursor is located at the end of the line).|0|
138-
|VimCheckChr|If 1, |0|
139138
|VimRestoreIME|If 1, IME status is restored at entering the insert mode.|1|
140139
|VimJJ|If 1, `jj` changes the mode to the normal mode from the insert mode.|0|
141140
|VimTwoLetterEsc|A list of character pairs to press together during the insert mode to get to the Normal mode.<br>For example, a value of `jf` means pressing `j` and `f` at the same time will enter the Normal mode.<br>Multiple combination can be set by separated by `,`. (e.g. `jf,jk,sd`)||

lib/vim_ahk.ahk

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ class VimAhk{
108108
this.AddToConf("VimChangeCaretWidth", 0, 0
109109
, "Change to thick text caret when in normal mode"
110110
, "When entering normal mode, sets the text cursor/caret to a thick bar, then sets back to thin when exiting normal mode.`nDoesn't work with all windows, and causes the current window to briefly lose focus when changing mode.")
111-
this.AddToConf("VimCheckChr", 0, 0
112-
, "Check the character before an action"
113-
, "Check the character under the cursor before an action.`nCurrently, this is used for: 'a' in the normal mode (check if the cursor is located the end of the line).")
114111
this.AddToConf("VimRestoreIME", 1, 1
115112
, "Restore IME status at entering the insert mode"
116113
, "Save the IME status in the insert mode, and restore it at entering the insert mode.")
@@ -142,7 +139,7 @@ class VimAhk{
142139
, "Application"
143140
, "Set one application per line.`n`nIt can be any of Window Title, Class or Process.`nYou can check these values by Window Spy (in the right click menu of tray icon).")
144141

145-
this.CheckBoxes := ["VimEscNormal", "VimSendEscNormal", "VimLongEscNormal", "VimCtrlBracketToEsc", "VimCtrlBracketNormal", "VimSendCtrlBracketNormal", "VimLongCtrlBracketNormal", "VimRestoreIME", "VimJJ", "VimChangeCaretWidth", "VimCheckChr"]
142+
this.CheckBoxes := ["VimEscNormal", "VimSendEscNormal", "VimLongEscNormal", "VimCtrlBracketToEsc", "VimCtrlBracketNormal", "VimSendCtrlBracketNormal", "VimLongCtrlBracketNormal", "VimRestoreIME", "VimJJ", "VimChangeCaretWidth"]
146143

147144
; ToolTip Information
148145
this.Info := {}
@@ -280,9 +277,6 @@ class VimAhk{
280277

281278
; Ref: https://www.reddit.com/r/AutoHotkey/comments/4ma5b8/identifying_end_of_line_when_typing_with_ahk_and/
282279
CheckChr(key){
283-
if(this.Conf["VimCheckChr"]["val"] == 0){
284-
Return False
285-
}
286280
BlockInput, Send
287281
tempClip := clipboard
288282
clipboard := ""

lib/vim_move.ahk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,15 @@
158158
}
159159
}else if(key == "e"){
160160
if(this.shift == 1){
161-
Send, +^{Right}+^{Right}+{Left}
161+
if(this.Vim.CheckChr(" ")){
162+
Send, +^{Right}
163+
}
164+
Send, +^{Right}+{Left}
162165
}else{
163-
Send, ^{Right}^{Right}{Left}
166+
if(this.Vim.CheckChr(" ")){
167+
Send, ^{Right}
168+
}
169+
Send, ^{Right}{Left}
164170
}
165171
}else if(key == "b"){
166172
if(this.shift == 1){

lib/vim_setting.ahk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class VimSetting Extends VimGui{
55
}
66

77
MakeGui(){
8-
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth, VimCheckChr
8+
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth
99
global VimDisableUnused, VimSetTitleMatchMode, VimSetTitleMatchModeFS, VimIconCheckInterval, VimVerbose, VimAppList, VimGroup, VimGroupList, VimTwoLetterList
1010
global VimDisableUnusedText, VimSetTitleMatchModeText, VimIconCheckIntervalText, VimIconCheckIntervalEdit, VimVerboseText, VimAppListText, VimGroupText, VimHomepage, VimSettingOK, VimSettingReset, VimSettingCancel, VimTwoLetterText
1111
this.VimVal2V()
@@ -92,7 +92,7 @@ class VimSetting Extends VimGui{
9292
}
9393

9494
UpdateGuiValue(){
95-
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth, VimCheckChr
95+
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth
9696
global VimDisableUnused, VimSetTitleMatchMode, VimSetTitleMatchModeFS, VimIconCheckInterval, VimVerbose, VimAppList, VimGroup, VimGroupList, VimTwoLetter, VimTwoLetterList
9797
for i, k in this.Vim.Checkboxes {
9898
GuiControl, % this.Hwnd ":", % k, % %k%
@@ -140,7 +140,7 @@ class VimSetting Extends VimGui{
140140
}
141141

142142
VimV2Conf(){
143-
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth, VimCheckChr
143+
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth
144144
global VimDisableUnused, VimSetTitleMatchMode, VimSetTitleMatchModeFS, VimIconCheckInterval, VimVerbose, VimAppList, VimGroup, VimGroupList, VimTwoLetter, VimTwoLetterList
145145
VimGroup := this.VimParseList(VimGroupList)
146146
VimTwoLetter := this.VimParseList(VimTwoLetterList)
@@ -167,7 +167,7 @@ class VimSetting Extends VimGui{
167167
}
168168

169169
VimConf2V(vd){
170-
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth, VimCheckChr
170+
global VimRestoreIME, VimJJ, VimEscNormal, VimSendEscNormal, VimLongEscNormal, VimCtrlBracketToEsc, VimCtrlBracketNormal, VimSendCtrlBracketNormal, VimLongCtrlBracketNormal, VimChangeCaretWidth
171171
global VimDisableUnused, VimSetTitleMatchMode, VimSetTitleMatchModeFS, VimIconCheckInterval, VimVerbose, VimAppList, VimGroup, VimGroupList, VimTwoLetterList
172172
StringReplace, VimGroupList, % this.Vim.Conf["VimGroup"][vd], % this.Vim.GroupDel, `n, All
173173
StringReplace, VimTwoLetterList, % this.Vim.Conf["VimTwoLetter"][vd], % this.Vim.GroupDel, `n, All

0 commit comments

Comments
 (0)