Skip to content

Commit 389b9c7

Browse files
committed
* Added option to show group names as comments in *View menu* > *Preview Script* and Preview panel toolbar.
* Fixed *Expand all groups* not working. * Fixed global context condition being set to macro context.
1 parent 72ab84b commit 389b9c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+175
-22
lines changed

Documentation/About.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ chosen1ft for fixing the mixing rows bug when saving a project.
3838
# Change Log
3939

4040
## Version 5.2.8
41+
* Added option to show Group names as comments in *View menu* > *Preview Script* and Preview toolbar.
4142
* Fixed `A_` variables not working as `InputVar` parameter for commands.
42-
* Fixed some hotkeys not updating Play hotkey.
43+
* Fixed *Expand all groups* not working.
44+
* Fixed some hotkeys not updating the Play hotkey.
4345
* Fixed problem with subtraction in expressions.
46+
* Fixed global context condition being set to macro context.
4447

4548
## Version 5.2.7
4649
* Added support for `&`, `*`, `~` and `Up` as modifier symbols for Play hotkey.

Documentation/Preview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ Converts line break symbols (\`n) in command parameters to real line breaks.
4545

4646
Keeps unchecked rows in the macro as commented out script, instead of not exporting them.
4747

48+
### Show groups as comments
49+
50+
Adds group names as single-line comments in the preview/exported script.
51+
4852
### Line Wrap
4953

5054
Automatically add a line break to long lines.

LIB/Class_LV_Rows.ahk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,11 @@ Class LV_Rows extends LV_Rows.LV_EX
966966
; automatically in from other functions, usually it's not
967967
; necessary to use it in your script.
968968
; Parameters:
969-
; Collapsed: If true collapses all groups in the selected ListView.
969+
; Collapsed: If true collapses all groups in the selected ListView. If false
970+
; expands all groups in selected ListView.
970971
; Return: No return value.
971972
;=======================================================================================
972-
RefreshGroups(Collapsed := false)
973+
RefreshGroups(Collapsed := "")
973974
{
974975
GroupStates := []
975976
Gui, Listview, % this.LVHwnd
@@ -985,7 +986,10 @@ Class LV_Rows extends LV_Rows.LV_EX
985986
If (this.Handle.GroupsArray[GrNum].Row = A_Index)
986987
{
987988
this.GroupInsert(GrNum + 9, this.Handle.GroupsArray[GrNum].Name)
988-
, Styles := Collapsed ? ["Collapsible", "Collapsed"] : this.Collapsible ? ["Collapsible", GroupStates[GrNum]] : []
989+
, Styles := !this.Collapsible ? []
990+
: Collapsed = "" ? ["Collapsible", GroupStates[GrNum]]
991+
: Collapsed ? ["Collapsible", "Collapsed"]
992+
: ["Collapsible", ""]
989993
, this.GroupSetState(GrNum + 9, Styles*)
990994
, GrNum++
991995
}

LIB/Definitions.ahk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,10 +1122,10 @@ DefaultBar := {FileOpt: "Enabled AutoSize", File: ["New=" w_Lang112 ":41", "Open
11221122
, "", "Import=" w_Lang076 ":28", "SaveCurrentList=" w_Lang077 ":67"
11231123
, "", "UserFunction=" w_Lang104 ":35", "FuncParameter=" w_Lang105 ":107", "FuncReturn=" w_Lang106 ":105"]}
11241124
FixedBar := {PrevOpt: "Enabled AutoSize", Preview: ["PrevCopy=" c_Lang023 ":8", "PrevRefreshButton=" t_Lang014 ":90(Enabled Dropdown)", "GoToLine=" t_Lang218 ":22(Enabled Dropdown)"
1125-
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)"
1125+
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5(Enabled Dropdown)", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)"
11261126
, "", "EditScript=" t_Lang138 ":109", "PrevDock=" t_Lang124 ":106", "Preview=" c_Lang022 ":108"]
11271127
, PreviewF: ["PrevCopy=" c_Lang023 ":8", "PrevRefreshButton=" t_Lang014 ":90(Enabled Dropdown)", "GoToLine=" t_Lang218 ":22(Enabled Dropdown)"
1128-
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)", "OnTop=" t_Lang016 ":81"
1128+
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5(Enabled Dropdown)", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)", "OnTop=" t_Lang016 ":81"
11291129
, "", "EditScript=" t_Lang138 ":109", "PrevDock=" t_Lang125 ":93"]
11301130
, TextOpt: "Enabled AutoSize", Text: ["OpenT=" t_Lang126 ":42", "SaveT=" t_Lang127 ":59"
11311131
, "", "CutT=" t_Lang128 ":9", "CopyT=" t_Lang129 ":8", "PasteT=" t_Lang130 ":44"

LIB/Export.ahk

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
, PAction, PType, PDelayX, PComment, Act, iCount, init_ie, ComExp
66
, VarsScope, FuncParams, IsFunction := false, CommentOut := false
77
, CDO_To, CDO_Sub, CDO_Msg, CDO_Att, CDO_Html, CDO_CC, CDO_BCC, SelAcc
8-
, _each, _Section, _CodeLine
8+
, _each, _Section, _CodeLine, _Groups, _NextGroup := 1
99
Gui, chMacro:Default
1010
Gui, chMacro:ListView, InputList%ListID%
1111
ComType := ComCr ? "ComObjCreate" : "ComObjActive"
12+
_Groups := LVManager[ListID].GetGroups(true)
1213
Critical
1314
Loop, % LV_GetCount()
1415
{
1516
LV_GetTexts(A_Index, Action, Step, TimesX, DelayX, Type, Target, Window, Comment)
1617
, IsChecked := LV_GetNext(A_Index-1, "Checked")
18+
If ((ShowGroupNames) && (_Groups[_NextGroup].Row = A_Index))
19+
LVData .= "`n`; " _Groups[_NextGroup].Name, _NextGroup++
1720
If (CodeLines) {
1821
StrReplace(LVData, "`n", "", _CodeLine)
1922
, CodeLines.Push(_CodeLine + 1)
@@ -541,11 +544,10 @@
541544
}
542545
}
543546
If ((IsChecked = A_Index) && (CommentOut))
544-
LVData .= "`n*/" RowData, CommentOut := false
547+
RowData := "`n*/" RowData, CommentOut := false
545548
Else If ((IsChecked != A_Index) && (!CommentOut) && (Type != cType42))
546-
LVData .= "`n/*" RowData, CommentOut := true
547-
Else
548-
LVData .= RowData
549+
RowData := "`n/*" RowData, CommentOut := true
550+
LVData .= RowData
549551
}
550552
If (CommentOut)
551553
LVData .= "`n*/"

LIB/Internal.ahk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,12 @@ ShowMenu(Menu, mX, mY)
11431143
Menu, TbMenu, Check, %t_Lang211%
11441144
Menu, TbMenu, Show, %mX%, %mY%
11451145
Menu, TbMenu, DeleteAll
1146+
Case "CommentUnchecked":
1147+
Menu, TbMenu, Add, %w_Lang114%, ShowGroupNames
1148+
If (ShowGroupNames)
1149+
Menu, TbMenu, Check, %w_Lang114%
1150+
Menu, TbMenu, Show, %mX%, %mY%
1151+
Menu, TbMenu, DeleteAll
11461152
Case "PrevFontShow":
11471153
Menu, PrevFontMenu, Add, 6, PrevFontSet, Radio
11481154
Menu, PrevFontMenu, Add, 7, PrevFontSet, Radio

Lang/ar.lang

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
v_Lang036 = تحويل فواصل الأسطر(&O)
154154
v_Lang037 = التعليق خارج الصفوف دون رادع(&M)
155155
v_Lang038 = التفاف الخط(&L)
156+
v_Lang039 = إظهار المجموعات كتعليقات(&H)
156157

157158
; 09. Options Sub Menu
158159
o_Lang001 = إعدادات(&S)
@@ -311,6 +312,7 @@
311312
w_Lang111 = البحث عن... (اضغط على Enter للانتقال)
312313
w_Lang112 = جديدة (السيطرة+N)
313314
w_Lang113 = اذهب إلى...
315+
w_Lang114 = إظهار المجموعات كتعليقات
314316

315317
; 15. Command Windows
316318
c_Lang001 = فأر

Lang/bg.lang

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
v_Lang036 = К&онвертиране на нови редове
154154
v_Lang037 = Ко&ментирайте непроверени редове
155155
v_Lang038 = &Line обвивка
156+
v_Lang039 = По&казване на групи като коментари
156157

157158
; 09. Options Sub Menu
158159
o_Lang001 = &Настройки
@@ -311,6 +312,7 @@
311312
w_Lang111 = Търсене... (Натиснете Enter, за да отидете)
312313
w_Lang112 = New (Ctrl+N)
313314
w_Lang113 = Otidete
315+
w_Lang114 = Показване на групи като коментари
314316

315317
; 15. Command Windows
316318
c_Lang001 = Мишка

Lang/ca.lang

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
v_Lang036 = C&onverteix salts de línia
154154
v_Lang037 = Co&menteu files sense marcar
155155
v_Lang038 = En&rotlleu
156+
v_Lang039 = Mostra e&ls grups com a comentaris
156157

157158
; 09. Options Sub Menu
158159
o_Lang001 = &Configuració
@@ -311,6 +312,7 @@
311312
w_Lang111 = Cercar... (Premeu Retorn per anar)
312313
w_Lang112 = Nou (Ctrl+N)
313314
w_Lang113 = Anar a...
315+
w_Lang114 = Mostra els grups com a comentaris
314316

315317
; 15. Command Windows
316318
c_Lang001 = Ratolí

Lang/cs.lang

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
v_Lang036 = P&řevod řádků
154154
v_Lang037 = Ko&mentář mimo nezkontrolované řádků
155155
v_Lang038 = &Zalamovat
156+
v_Lang039 = Zo&brazit skupiny jako komentáře
156157

157158
; 09. Options Sub Menu
158159
o_Lang001 = &Nastavení
@@ -311,6 +312,7 @@
311312
w_Lang111 = Vyhledávání... (Klávesou Enter prejdete)
312313
w_Lang112 = New (Ctrl+N)
313314
w_Lang113 = Jít do...
315+
w_Lang114 = Zobrazit skupiny jako komentáře
314316

315317
; 15. Command Windows
316318
c_Lang001 = Myš

0 commit comments

Comments
 (0)