From 6348db6799aede103ed69522affc79411cb67e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 1 Dec 2020 22:42:41 +0100 Subject: Switch from spaces to tabs --- tt.programs.explorer.ahk | 154 +++++++++++++++++++++++------------------------ 1 file changed, 77 insertions(+), 77 deletions(-) (limited to 'tt.programs.explorer.ahk') diff --git a/tt.programs.explorer.ahk b/tt.programs.explorer.ahk index 4c4276e..0d31034 100644 --- a/tt.programs.explorer.ahk +++ b/tt.programs.explorer.ahk @@ -14,22 +14,22 @@ GroupAdd, ExplorerDesktop, ahk_class WorkerW Explorer(hwnd := "") { - global ShellApp - if (hwnd = "") - WinGet, hwnd, id, A - for window in ShellApp.Windows - if (window.hwnd = hwnd) - return window - return -1 + global ShellApp + if (hwnd = "") + WinGet, hwnd, id, A + for window in ShellApp.Windows + if (window.hwnd = hwnd) + return window + return -1 } ExplorerPath() { - WinGetClass, cls, A - if (cls = "Progman" or cls = "WorkerW") - return %A_Desktop% - else - return Explorer().Document.Folder.Self.path + WinGetClass, cls, A + if (cls = "Progman" or cls = "WorkerW") + return %A_Desktop% + else + return Explorer().Document.Folder.Self.path } ;; -> body @@ -72,11 +72,11 @@ LWin & LButton:: MouseGetPos,,, hwnd DllCall("SetForegroundWindow", "UInt", hwnd) if (not DoubleClick()) ; see tt.doubleclick.ahk - return + return if (not WinActive("ahk_group Explorer")) { - SendInput, {Click} - return + SendInput, {Click} + return } ; fall through to next hotkey @@ -86,7 +86,7 @@ if (not WinActive("ahk_group Explorer")) #Enter:: i := Explorer().Document.FocusedItem if (i.IsFolder) - return + return ShellApp.ShellExecute(i.path, "", "", "Edit", 1) return @@ -97,14 +97,14 @@ RAlt & Up:: e := Explorer() path := e.Document.Folder.Self.path if (InStr(path, "::{") = 1) - return + return slash := InStr(path, "\", 0, 0) if (slash = StrLen(path)) - slash := InStr(path, "\", 0, 0, 2) + slash := InStr(path, "\", 0, 0, 2) if (slash = 0) - parent = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D} ; My Computer + parent = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D} ; My Computer else - parent := SubStr(path, 1, slash) + parent := SubStr(path, 1, slash) e.Navigate(parent) return @@ -112,7 +112,7 @@ LAlt & Down:: RAlt & Down:: path := ExplorerPath() if (InStr(path, "::{") = 1) - return + return Explorer().Navigate(path) ; go to real path of folder return @@ -126,7 +126,7 @@ NumPut(NumGet(SHELLSTATE) ^ (1 << 0), SHELLSTATE,, "Int") DllCall("Shell32\SHGetSetSettings", "Ptr", &SHELLSTATE, "UInt", SSF_SHOWALLOBJECTS, "Int", true) WinGet, win, List, ahk_group Explorer Loop, % win - PostMessage, 0x111, 41504,,, % "ahk_id " win%A_Index% ; refresh + PostMessage, 0x111, 41504,,, % "ahk_id " win%A_Index% ; refresh return ; Sort and display options @@ -159,41 +159,41 @@ return ExplorerFolderView(view, children := false) { - if (view = "name") - n := {m: 30210, d: -1} - else if (view = "modified") - n := {m: 30213, d: -1} - else if (view = "type") - n := {m: 30212, d: -1} - else if (view = "created") - n := {m: 30214, d: -1} - else if (view = "groups") - n := {m: 30209, d: -1} - else if (view = "tiles") - n := {m: 28718, d: 6} - else if (view = "icons") - n := {m: 28713, d: 1} - else if (view = "thumbnails") - n := {m: 28717, d: 5} - else if (view = "details") - n := {m: 28716, d: 4} - else if (view = "list") - n := {m: 28715, d: 3} - - PostMessage, 0x111, % n.m, 0,, A ; change current folder - return - if (not children or m.d = -1) - return - - old := A_BatchLines - SetBatchLines, -1 - - Loop, Files, % ExplorerPath() "\*", D - { - MsgBox, % A_LoopFileFullPath - } - - SetBatchLines, % old + if (view = "name") + n := {m: 30210, d: -1} + else if (view = "modified") + n := {m: 30213, d: -1} + else if (view = "type") + n := {m: 30212, d: -1} + else if (view = "created") + n := {m: 30214, d: -1} + else if (view = "groups") + n := {m: 30209, d: -1} + else if (view = "tiles") + n := {m: 28718, d: 6} + else if (view = "icons") + n := {m: 28713, d: 1} + else if (view = "thumbnails") + n := {m: 28717, d: 5} + else if (view = "details") + n := {m: 28716, d: 4} + else if (view = "list") + n := {m: 28715, d: 3} + + PostMessage, 0x111, % n.m, 0,, A ; change current folder + return + if (not children or m.d = -1) + return + + old := A_BatchLines + SetBatchLines, -1 + + Loop, Files, % ExplorerPath() "\*", D + { + MsgBox, % A_LoopFileFullPath + } + + SetBatchLines, % old } ;; Git hotkeys ---------------------------------------------------------------- @@ -202,26 +202,26 @@ ExplorerFolderView(view, children := false) q(s) { - return """" s """" + return """" s """" } qp() { - return """" Explorer().Document.Folder.Self.path """" + return """" Explorer().Document.Folder.Self.path """" } qip() { - r := "" - for item in Explorer().Document.SelectedItems - r .= """" item.path """ " - return r + r := "" + for item in Explorer().Document.SelectedItems + r .= """" item.path """ " + return r } basename(s) { - slash := InStr(path, "\", 0, 0) - return SubStr(path, slash + 1) + slash := InStr(path, "\", 0, 0) + return SubStr(path, slash + 1) } ;; -> body @@ -237,49 +237,49 @@ basename(s) !a:: qip := qip() if (qip = "") - Run, % "cmd /c cd "qp()" & git add . && git status & pause" + Run, % "cmd /c cd "qp()" & git add . && git status & pause" else - Run, % "cmd /c cd "qp()" & git add " qip " && git status & pause" + Run, % "cmd /c cd "qp()" & git add " qip " && git status & pause" return !+a:: qip := qip() if (qip = "") - Run, % "cmd /c cd "qp()" & git add -p . && git status & pause" + Run, % "cmd /c cd "qp()" & git add -p . && git status & pause" else - Run, % "cmd /c cd "qp()" & git add -p " qip " && git status & pause" + Run, % "cmd /c cd "qp()" & git add -p " qip " && git status & pause" return !f:: qip := qip() if (qip = "") - Run, % "cmd /c cd "qp()" & git diff & pause" + Run, % "cmd /c cd "qp()" & git diff & pause" else - Run, % "cmd /c cd "qp()" & git diff " qip " & pause" + Run, % "cmd /c cd "qp()" & git diff " qip " & pause" return !i:: qip := qip() if (qip = "") - Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD & pause" + Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD & pause" else - Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD " qip " & pause" + Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD " qip " & pause" return !l:: qip := qip() if (qip = "") - Run, % "cmd /c cd "qp()" & git log & pause" + Run, % "cmd /c cd "qp()" & git log & pause" else - Run, % "cmd /c cd "qp()" & git log " qip " & pause" + Run, % "cmd /c cd "qp()" & git log " qip " & pause" return !r:: qip := qip() if (qip = "") - Run, % "cmd /c cd "qp()" & git reset . && git status & pause" + Run, % "cmd /c cd "qp()" & git reset . && git status & pause" else - Run, % "cmd /c cd "qp()" & git reset " qip " && git status & pause" + Run, % "cmd /c cd "qp()" & git reset " qip " && git status & pause" return #IfWinActive -- cgit v1.2.3