Skip to content

Commit

Permalink
refactor: Rename variables to follow consistent camelCase convention
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmdnk committed Sep 28, 2024
1 parent f542eff commit 9a5b57a
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 140 deletions.
8 changes: 4 additions & 4 deletions lib/vim_about.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@


class VimAbout Extends VimGui{
__New(vim){
super.__New(vim, "Vim Ahk")
__New(Vim){
super.__New(Vim, "Vim Ahk")

this.Vim := vim
this.Vim := Vim

this.Version := ""
this.Date := ""
Expand All @@ -30,7 +30,7 @@ class VimAbout Extends VimGui{
this.HwndAll.Push(this.Hwnd["VimAboutOK"])
}

OpenHomepage(btn, info){
OpenHomepage(*){
this.Vim.VimToolTip.RemoveToolTip()
Run(this.Homepage)
}
Expand Down
14 changes: 7 additions & 7 deletions lib/vim_ahk.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ class VimAhk{
}
}

SetTwoLetterMap(key1, key2){
SetTwoLetterMap(Key1, Key2){
Enabled := ObjBindMethod(this, "TwoLetterNormalMapsEnabled")
SendSame := ObjBindMethod(this, "SendSame")
EnterNormal := ObjBindMethod(this, "TwoLetterEnterNormal")
HotIf(Enabled)
HotKey(key1, SendSame)
HotKey(key2, SendSame)
HotKey(key1 " & " key2, EnterNormal)
HotKey(key2 " & " key1, EnterNormal)
HotKey(Key1, SendSame)
HotKey(Key2, SendSame)
HotKey(Key1 " & " Key2, EnterNormal)
HotKey(Key2 " & " Key1, EnterNormal)
HotIf()
}

Expand Down Expand Up @@ -289,14 +289,14 @@ class VimAhk{
}

; Ref: https://www.reddit.com/r/AutoHotkey/comments/4ma5b8/identifying_end_of_line_when_typing_with_ahk_and/
CheckChr(key){
CheckChr(Key){
BlockInput("Send")
ClipSaved := ClipboardAll()
A_Clipboard := ""
SendInput("{Shift Down}{Right}{Shift up}{Ctrl down}c{Ctrl Up}{Left}")
Sleep(10)
ret := False
If (A_Clipboard ~= key){
If (A_Clipboard ~= Key){
ret := True
}
sleep(10)
Expand Down
24 changes: 12 additions & 12 deletions lib/vim_caret.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class VimCaret{
__New(vim){
this.Vim := vim
__New(Vim){
this.Vim := Vim
this.caretwidths := Map("Normal", 10
, "Visual", 10
, "Insert", 1
Expand All @@ -11,29 +11,29 @@ class VimCaret{
if (this.Vim.Conf["VimChangeCaretWidth"]["val"] == 0){
return
}
width := ""
Width := ""
if this.Vim.State.IsCurrentVimMode("Vim_Normal"){
width := this.caretwidths["Normal"]
Width := this.caretwidths["Normal"]
}else if this.Vim.State.StrIsInCurrentVimMode("Visual"){
width := this.caretwidths["Visual"]
Width := this.caretwidths["Visual"]
}else if this.Vim.State.IsCurrentVimMode("Insert"){
width := this.caretwidths["Insert"]
Width := this.caretwidths["Insert"]
}else{
width := this.caretwidths["Default"]
Width := this.caretwidths["Default"]
}
this.SetCaretWidth(width)
this.SetCaretWidth(Width)
}

; Expects argument "width" in hex
SetCaretWidth(width){
CARETWIDTH := width
; Expects argument "Width" in hex
SetCaretWidth(Width){
CARETWIDTH := Width
; SPI := SystemParametersInfo
SPI_SETCARETWIDTH := 0x2007
SPIF_UPDATEINIFILE := 0x01
SPIF_SENDCHANGE := 0x02
fWinIni := SPIF_UPDATEINIFILE | SPIF_SENDCHANGE
DllCall("SystemParametersInfo", "UInt", SPI_SETCARETWIDTH, "UInt", 0, "UInt", CARETWIDTH, "UInt", fWinIni)
; Switch focus to another window and back to update caret width
; Switch focus to another window and back to update caret Width
this.Refocus()
}

Expand Down
6 changes: 3 additions & 3 deletions lib/vim_check.ahk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class VimCheck{
__New(vim){
this.Vim := vim
__New(Vim){
this.Vim := Vim
}

CheckMenu(ItemName, ItemPos, MyMenu) {
CheckMenu(*) {
; Additional message is necessary before checking current window.
; Otherwise process name cannot be retrieved...?
MsgBox("Checking current window...", "Vim Ahk")
Expand Down
22 changes: 11 additions & 11 deletions lib/vim_gui.ahk
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
class VimGui{
__New(vim, title){
this.Vim := vim
__New(Vim, Title){
this.Vim := Vim
this.Hwnd := 0
this.HwndAll := []
this.Title := title
this.Title := Title
this.OKObj := ObjBindMethod(this, "OK")
}

ShowGui(name, pos, mymenu){
ShowGui(*){
if(this.Hwnd == 0){
this.Hwnd := Gui("", this.Title)
this.HwndAll.Push(this.Hwnd)
Expand All @@ -33,27 +33,27 @@ class VimGui{
this.Hwnd.Hide()
}

OK(btn, info){
OK(*){
this.Hide()
}

IsThisWindow(hwnd){
IsThisWindow(Hwnd){
for i, h in this.HwndAll {
if(hwnd == h){
if(Hwnd == h){
Return True
}
}
Return False
}

OnClose(wp, lp, msg, hwnd){
if(wp == 0xF060 && hwnd == this.Hwnd){
OnClose(Wp, Lp, Msg, Hwnd){
if(Wp == 0xF060 && Hwnd == this.Hwnd){
this.Hide()
}
}

OnEscape(wp, lp, msg, hwnd){
if(wp == 27 && this.IsThisWindow(hwnd)){
OnEscape(Wp, Lp, Msg, Hwnd){
if(Wp == 27 && this.IsThisWindow(Hwnd)){
this.Hide()
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/vim_icon.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class VimIcon{
__New(vim){
this.Vim := vim
__New(Vim){
this.Vim := Vim
this.icons := Map("Normal", this.Vim.ScriptPath "\..\vim_ahk_icons\normal.ico"
, "Insert", this.Vim.ScriptPath "\..\vim_ahk_icons\insert.ico"
, "Visual", this.Vim.ScriptPath "\..\vim_ahk_icons\visual.ico"
Expand Down
46 changes: 23 additions & 23 deletions lib/vim_ini.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
static Ini_Default := "vim_ahk.ini"
static Section_Default := "Vim Ahk Settings"

__New(vim, dir:="", ini:="", section:=""){
this.Vim := vim
if(dir == ""){
dir := VimIni.IniDir_Default
__New(Vim, Dir:="", Ini:="", Section:=""){
this.Vim := Vim
if(Dir == ""){
Dir := VimIni.IniDir_Default
}
if(ini == ""){
ini := VimIni.Ini_Default
if(Ini == ""){
Ini := VimIni.Ini_Default
}
if(section == ""){
section := VimIni.Section_Default
if(Section == ""){
Section := VimIni.Section_Default
}
this.IniDir := dir
this.Ini := dir "\" ini
this.section := section
this.IniDir := Dir
this.Ini := Dir "\" Ini
this.section := Section
}

ReadIni(conf:=""){
if (conf == ""){
conf := this.Vim.Conf
ReadIni(Conf:=""){
if (Conf == ""){
Conf := this.Vim.Conf
}
for k, v in conf {
current := v["val"]
if(current != ""){
val := IniRead(this.Ini, this.Section, k, current)
for k, v in Conf {
Current := v["val"]
if(Current != ""){
val := IniRead(this.Ini, this.Section, k, Current)
}else{
val := IniRead(this.Ini, this.Section, k, A_Space)
}
Expand All @@ -41,16 +41,16 @@
this.DeprecatedTwoLetter("j", "k")
}

DeprecatedTwoLetter(l1, l2){
ul1 := StrUpper(l1)
ul2 := StrUpper(l2)
DeprecatedTwoLetter(L1, L2){
ul1 := StrUpper(L1)
ul2 := StrUpper(L2)
twoLetter := "Vim" ul1 ul2
val := IniRead(this.Ini, this.Section, twoLetter, 0)
if (val == 1){
if (this.Vim.Conf["VimTwoLetter"]["val"] == ""){
this.Vim.Conf["VimTwoLetter"]["val"] := l1 l2
this.Vim.Conf["VimTwoLetter"]["val"] := L1 L2
}else{
this.Vim.Conf["VimTwoLetter"]["val"] := this.Vim.Conf["VimTwoLetter"]["val"] this.Vim.GroupDel l1 l2
this.Vim.Conf["VimTwoLetter"]["val"] := this.Vim.Conf["VimTwoLetter"]["val"] this.Vim.GroupDel L1 L2
}
}
IniDelete(this.Ini, this.Section, twoLetter)
Expand Down
4 changes: 2 additions & 2 deletions lib/vim_menu.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class VimMenu{
__New(vim){
this.Vim := vim
__New(Vim){
this.Vim := Vim
}

SetMenu(){
Expand Down
Loading

0 comments on commit 9a5b57a

Please sign in to comment.