@@ -79,6 +79,7 @@ bool EditorRepeatText()
79
79
Dialog.Add (new CFarTextItem (27 , 7 , 0 , MTimes));
80
80
81
81
Dialog.AddButtons (MOk, MCancel, MBtnClose);
82
+ Dialog.Add (new CFarButtonItem (64 , 9 , 0 , FALSE , MBtnPresets));
82
83
83
84
ReplaceText = PickupMultilineSelection ();
84
85
if (ReplaceText.empty ()) ReplaceText = ERReplace;
@@ -92,6 +93,9 @@ bool EditorRepeatText()
92
93
case MQuoteReplace:
93
94
CSO::QuoteReplaceString (ReplaceText);
94
95
break ;
96
+ case MBtnPresets:
97
+ EPPresets->ShowMenu (true );
98
+ break ;
95
99
case MRunEditor:
96
100
RunExternalEditor (ReplaceText);
97
101
break ;
@@ -115,3 +119,66 @@ bool EditorRepeatText()
115
119
116
120
return true ;
117
121
}
122
+
123
+ OperationResult EditorRepeatExecutor ()
124
+ {
125
+ if (!EditorUpdateSelectionPosition ())
126
+ return OR_FAILED;
127
+
128
+ if (!CompileLUAString (ReplaceText, ScriptEngine (EREvaluate))) return OR_FAILED;
129
+
130
+ #ifdef UNICODE
131
+ ERReplace = ReplaceText;
132
+ #else
133
+ ERReplace = ERReplace_O2E = ReplaceText;
134
+ OEMToEditor (ERReplace_O2E);
135
+ #endif
136
+
137
+ NoAsking = true ;
138
+ FindNumber = ReplaceNumber = 0 ;
139
+ REParam.m_setInitParam .clear ();
140
+ SanitateEngine ();
141
+
142
+ bool bResult = EditorRepeatAgain ();
143
+ StartupInfo.EditorControl (ECTL_REDRAW, NULL );
144
+ return bResult ? OR_OK : OR_CANCEL;
145
+ }
146
+
147
+ bool CEPPresetCollection::EditPreset (CPreset *pPreset)
148
+ {
149
+ CFarDialog Dialog (80 , 17 , _T (" EPPresetDlg" ));
150
+ Dialog.SetUseID (true );
151
+
152
+ Dialog.AddFrame (MEPPreset);
153
+ Dialog.Add (new CFarTextItem (5 , 2 , 0 , MPresetName));
154
+ Dialog.Add (new CFarEditItem (5 , 3 , 74 , DIF_HISTORY,_T (" RESearch.PresetName" ), pPreset->Name ()));
155
+
156
+ Dialog.Add (new CFarTextItem (5 , 4 , 0 , MTextToRepeat));
157
+ Dialog.Add (new CFarEditItem (5 , 5 , 69 , DIF_HISTORY|DIF_VAREDIT,_T (" ReplaceText" ), pPreset->m_mapStrings [" Replace" ]));
158
+ Dialog.Add (new CFarButtonItem (71 , 5 , 0 , 0 , MQuoteReplace));
159
+
160
+ Dialog.Add (new CFarTextItem (5 , 6 , DIF_BOXCOLOR|DIF_SEPARATOR, _T (" " )));
161
+
162
+ Dialog.Add (new CFarCheckBoxItem (5 , 7 , 0 , MEvaluateAsScript, &pPreset->m_mapInts [" AsScript" ]));
163
+ Dialog.Add (new CFarComboBoxItem (35 , 7 , 60 , 0 , new CFarListData (m_lstEngines, false ), new CFarEngineStorage (pPreset->m_mapStrings [" Script" ])));
164
+ Dialog.Add (new CFarButtonItem (64 , 7 , 0 , FALSE , MRunEditor));
165
+
166
+ Dialog.Add (new CFarTextItem (5 , 9 , 0 , MRepeatTimes));
167
+ Dialog.Add (new CFarEditItem (20 , 9 , 25 , 0 , NULL , &pPreset->m_mapInts [" RepeatCount" ], new CFarIntegerRangeValidator (1 , 16384 )));
168
+ Dialog.Add (new CFarTextItem (27 , 9 , 0 , MTimes));
169
+
170
+ Dialog.Add (new CFarCheckBoxItem (5 , 11 , 0 , MAddToMenu, &pPreset->m_bAddToMenu ));
171
+ Dialog.AddButtons (MOk, MCancel);
172
+
173
+ do {
174
+ switch (Dialog.Display ()) {
175
+ case MOk:
176
+ return true ;
177
+ case MRunEditor:
178
+ RunExternalEditor (pPreset->m_mapStrings [" Replace" ]);
179
+ break ;
180
+ default :
181
+ return false ;
182
+ }
183
+ } while (true );
184
+ }
0 commit comments