 GotoLine(Index)
 {
     Vim_HotKeyCount := 0
-    ControlGetFocus,Ctrl,AHK_CLASS TTOTAL_CMD
+    ControlGetFocus, Ctrl, AHK_CLASS TTOTAL_CMD
     If Index
     {
         ;Index--
-        ControlGet,text,List,,%ctrl%,AHK_CLASS TTOTAL_CMD
-        Stringsplit,T,Text,`n
+        ControlGet, text, List, , %ctrl%, AHK_CLASS TTOTAL_CMD
+        Stringsplit, T, Text, `n
         Last := T0 - 1
         If Index > %Last%
             Index := Last
-        Postmessage,0x19E,%Index%,1,%Ctrl%,AHK_CLASS TTOTAL_CMD
+        Postmessage, 0x19E, %Index%, 1, %Ctrl%, AHK_CLASS TTOTAL_CMD
     }
     Else
     {
-        ControlGet,text,List,,%ctrl%,AHK_CLASS TTOTAL_CMD
-        Stringsplit,T,Text,`n
+        ControlGet, text, List, , %ctrl%, AHK_CLASS TTOTAL_CMD
+        Stringsplit, T, Text, `n
         Last := T0 - 1
-        PostMessage, 0x19E,  %Last% , 1 , %CTRL%, AHK_CLASS TTOTAL_CMD
+        PostMessage, 0x19E, %Last% , 1 , %CTRL%, AHK_CLASS TTOTAL_CMD
     }
 }
 ; <Half>  {{{1
 ; 移动到窗口中间
 <Half>:
-        Half()
+    Half()
 return
 Half()
 {
-    winget,tid,id,ahk_class TTOTAL_CMD
-    controlgetfocus,ctrl,ahk_id %tid%
-    controlget,cid,hwnd,,%ctrl%,ahk_id %tid%
-    controlgetpos,x1,y1,w1,h1,THeaderClick2,ahk_id %tid%
-    controlgetpos,x,y,w,h,%ctrl%,ahk_id %tid%
-    SendMessage,0x01A1,1,0,,ahk_id %cid%
+    winget, tid, id, ahk_class TTOTAL_CMD
+    controlgetfocus, ctrl, ahk_id %tid%
+    controlget, cid, hwnd, , %ctrl%, ahk_id %tid%
+    controlgetpos, x1, y1, w1, h1, THeaderClick2, ahk_id %tid%
+    controlgetpos, x, y, w, h, %ctrl%, ahk_id %tid%
+    SendMessage, 0x01A1, 1, 0, , ahk_id %cid%
     Hight := ErrorLevel
-    SendMessage,0x018E,0,0,,ahk_id %cid%
+    SendMessage, 0x018E, 0, 0, , ahk_id %cid%
     Top := ErrorLevel
     HalfLine := Ceil( ((h-h1)/Hight)/2 ) + Top
     PostMessage, 0x19E, %HalfLine%, 1, , AHK_id %cid%

;激活TC，并定位到命令行
<FocusTCCmd>:
{
    gosub,<FocusTC>
    SendPos(4003)
    return
}

return
CreateNewFile()
{
    ControlGetFocus, TLB, ahk_class TTOTAL_CMD
    ControlGetPos, xn, yn, , , %TLB%, ahk_class TTOTAL_CMD
    Menu, FileTemp, Add
    Menu, FileTemp, DeleteAll
    Menu, FileTemp, Add , 0 新建文件, :CreateNewFile
    Menu, FileTemp, Icon, 0 新建文件, %A_WinDir%\system32\Shell32.dll, -152
    Menu, FileTemp, Add , 1 文件夹, <cm_Mkdir>
    Menu, FileTemp, Icon, 1 文件夹, %A_WinDir%\system32\Shell32.dll, 4
    Menu, FileTemp, Add , 2 快捷方式, <cm_CreateShortcut>
    If A_OSVersion in WIN_2000, WIN_XP
        Menu, FileTemp, Icon, 2 快捷方式, %A_WinDir%\system32\Shell32.dll, 30 ;我测试xp下必须是30
    Else Menu, FileTemp, Icon, 2 快捷方式, %A_WinDir%\system32\Shell32.dll, 264 ;原来是264，xp下反正是有问题
    Menu, FileTemp, Add , 3 添加到新模板, <AddToTempFiles>
    Menu, FileTemp, Icon, 3 添加到新模板, %A_WinDir%\system32\Shell32.dll, -155
    FileTempMenuCheck()
    Menu, FileTemp, Show, %xn%, %yn%
}
; 检查文件模板功能
FileTempMenuCheck()
{
    Global TCPath
    Splitpath, TCPath, , TCDir
    Loop, %TCDir%\shellnew\*.*
    {
        If A_Index = 1
            Menu, FileTemp, Add
        ft := chr(64+A_Index) . " >> " . A_LoopFileName
        Menu, FileTemp, Add, %ft%, FileTempNew
        Ext := "." . A_LoopFileExt
        IconFile := RegGetNewFileIcon(Ext)
        IconFile := RegExReplace(IconFile, "i)%systemroot%", A_WinDir)
        IconFilePath := RegExReplace(IconFile, ", -?\d*", "")
        StringReplace, IconFilePath, IconFilePath, ", , A
        IconFileIndex := RegExReplace(IconFile, ".*, ", "")
        IconFileIndex := IconFileIndex>=0?IconFileIndex+1:IconFileIndex
        ;MsgBox, %IconFile%_%IconFilePath%_%IconFileIndex%
        If Not FileExist(IconFilePath)
            Menu, FileTemp, Icon, %ft%, %A_WinDir%\system32\Shell32.dll, 1 ;-152
        Else
            Menu, FileTemp, Icon, %ft%, %IconFilePath%, %IconFileIndex%
    }
}
; 添加到文件模板中
