Skip to content

Commit

Permalink
refactor: update OpenHomepage method to accept Btn and Info parameters
Browse files Browse the repository at this point in the history
refactor: reorder TwoLetterNormalMapsEnabled method and update parameter
refactor: update CheckMenu method to accept ItemName, ItemPos, and MyMenu parameters
refactor: simplify supported window message in CheckMenu method
refactor: update ShowGui method to use additional parameters
fix: missing closing parentheses in OK method of VimGui class
refactor: update OK method to accept Btn and Info parameters in VimSetting
refactor: update Cancel and Reset methods to accept Btn and Info parameters
refactor: simplify verbose status display message in VimState class
refactor: update FullStatus method to use additional parameters
  • Loading branch information
rcmdnk committed Sep 28, 2024
1 parent 85fcf86 commit aca342c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 34 deletions.
2 changes: 1 addition & 1 deletion lib/vim_about.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class VimAbout Extends VimGui{
this.HwndAll.Push(this.Hwnd["VimAboutOK"])
}

OpenHomepage(*){
OpenHomepage(Btn, Info){
this.Vim.VimToolTip.RemoveToolTip()
Run(this.Homepage)
}
Expand Down
10 changes: 5 additions & 5 deletions lib/vim_ahk.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ class VimAhk{
HotIf()
}

SendSame(HotkeyName){
SendInput(HotkeyName)
TwoLetterNormalMapsEnabled(HotkeyName){
Return this.IsVimGroup() && (this.State.StrIsInCurrentVimMode("Insert")) && this.TwoLetterNormalIsSet
}

TwoLetterNormalMapsEnabled(*){
Return this.IsVimGroup() && (this.State.StrIsInCurrentVimMode("Insert")) && this.TwoLetterNormalIsSet
SendSame(HotkeyName){
SendInput(HotkeyName)
}

TwoLetterEnterNormal(*){
TwoLetterEnterNormal(HotkeyName){
this.State.SetNormal()
}

Expand Down
18 changes: 3 additions & 15 deletions lib/vim_check.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
this.Vim := Vim
}

CheckMenu(*) {
CheckMenu(ItemName, ItemPos, MyMenu) {
; Additional message is necessary before checking current window.
; Otherwise process name cannot be retrieved...?
MsgBox("Checking current window...", "Vim Ahk")
Expand All @@ -12,21 +12,9 @@
win_class := WinGetClass("ahk_pid " process)
title := WinGetTitle("ahk_pid " process)
if(this.Vim.IsVimGroup()){
MsgBox("
(
Supported
Process name: %name%
Class : %win_class%
Title : %title%
)", "Vim Ahk", "Iconi")
MsgBox("Supported`nProcess name: " name "`nClass : " win_class "`nTitle : " title, "Vim Ahk", "Iconi")
}else{
MsgBox("
(
Not supported
Process name: %name%
Class : %win_class%
Title : %title%
)", "Vim Ahk", "Iconx")
MsgBox("Not supported`nProcess name: " name "`nClass : " win_class "`nTitle : " title, "Vim Ahk", "Iconx")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/vim_gui.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class VimGui{
this.OKObj := ObjBindMethod(this, "OK")
}

ShowGui(*){
ShowGui(ItemName, ItemPos, MyMenu){
if(this.Hwnd == 0){
this.Hwnd := Gui("", this.Title)
this.HwndAll.Push(this.Hwnd)
Expand All @@ -33,7 +33,7 @@ class VimGui{
this.Hwnd.Hide()
}

OK(*){
OK(Btn, Info){
this.Hide()
}

Expand Down
6 changes: 3 additions & 3 deletions lib/vim_setting.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@ class VimSetting Extends VimGui{
return this.GetConf(Name, "description")
}

OK(*){
OK(Btn, Info){
this.Hwnd.Submit()
this.VimV2Conf()
this.Vim.Setup()
this.vim.Ini.WriteIni()
this.Hide()
}

Cancel(*){
Cancel(Btn, Info){
this.Hide()
}

Reset(*){
Reset(Btn, Info){
this.VimDefault2V()
this.UpdateGuiValue()
}
Expand Down
10 changes: 2 additions & 8 deletions lib/vim_state.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@
this.SetTooltip(this.Mode "`r`ng=" this.g "`r`nn=" this.n "`r`nLineCopy=" this.LineCopy, 4)
}
if(Verbose >= 4){
MsgBox("
(
Mode : %this.Mode%
Vim_g : %this.g%
Vim_n : %this.n%
VimLineCopy : %this.LineCopy%
)", "Vim Ahk")
MsgBox("Mode : " this.Mode "`nVim_g : " this.g "`nVim_n : " this.n "`nVimLineCopy : " this.LineCopy, "Vim Ahk")
}
}

Expand All @@ -48,7 +42,7 @@
this.Vim.VimToolTip.SetRemoveToolTip(1000)
}

FullStatus(*){
FullStatus(ItemName, ItemPos, MyMenu){
this.CheckMode(4, , , , 1)
}

Expand Down

0 comments on commit aca342c

Please sign in to comment.