mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: Remove DDUMPs (a function)
git-svn-id: svn://ultimatepp.org/upp/trunk@11752 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
8972c211f1
commit
0c9f9d476f
3 changed files with 44 additions and 3 deletions
|
|
@ -812,6 +812,7 @@ public:
|
|||
void InsertMenu(Bar& bar);
|
||||
void InsertInclude(Bar& bar);
|
||||
void InsertAdvanced(Bar& bar);
|
||||
void AssistEdit(Bar& menu);
|
||||
void EditorMenu(Bar& bar);
|
||||
void ToggleWordwrap();
|
||||
|
||||
|
|
@ -943,6 +944,7 @@ public:
|
|||
void GotoDirDiffRight(int line, DirDiffDlg *df);
|
||||
void DoDirDiff();
|
||||
void AsErrors();
|
||||
void RemoveDs();
|
||||
|
||||
void HelpMenu(Bar& menu);
|
||||
void ViewIdeLogFile();
|
||||
|
|
|
|||
|
|
@ -115,11 +115,18 @@ void Ide::OnlineSearchMenu(Bar& menu)
|
|||
menu.Add(b, AK_GOOGLEUPP, IdeImg::GoogleUpp(), THISBACK(OnlineSearchOnTheOfficialSite));
|
||||
}
|
||||
|
||||
void Ide::AssistEdit(Bar& menu)
|
||||
{
|
||||
bool b = !editor.IsReadOnly() && !designer;
|
||||
menu.Add(b, "Insert", THISBACK(InsertMenu));
|
||||
menu.Add(b, "Insert #include", THISBACK(InsertInclude));
|
||||
menu.Add(b, "Remove debugging logs (DDUMP...)", [=] { RemoveDs(); });
|
||||
}
|
||||
|
||||
void Ide::InsertAdvanced(Bar& bar)
|
||||
{
|
||||
bool b = !editor.IsReadOnly();
|
||||
bar.Add(b, "Insert", THISBACK(InsertMenu));
|
||||
bar.Add(b, "Insert #include", THISBACK(InsertInclude));
|
||||
AssistEdit(bar);
|
||||
bar.Add(b, "Advanced", THISBACK(EditSpecial));
|
||||
}
|
||||
|
||||
|
|
@ -680,7 +687,7 @@ void Ide::BrowseMenu(Bar& menu)
|
|||
menu.Add(!designer, AK_COMPLETE, callback(&editor, &AssistEditor::Complete));
|
||||
menu.Add(!designer, AK_ABBR, callback(&editor, &AssistEditor::Abbr));
|
||||
menu.Add(!designer, AK_GO_TO_LINE, THISBACK(GoToLine));
|
||||
menu.Add(!designer, "Insert", THISBACK(InsertMenu));
|
||||
AssistEdit(menu);
|
||||
menu.MenuSeparator();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -518,6 +518,38 @@ void Ide::AsErrors()
|
|||
SetErrorEditor();
|
||||
}
|
||||
|
||||
void Ide::RemoveDs()
|
||||
{
|
||||
if(designer || editor.IsReadOnly())
|
||||
return;
|
||||
static Index<String> ds = { "DLOG", "DDUMP", "DDUMPC", "DDUMPM", "DTIMING",
|
||||
"DLOGHEX", "DDUMPHEX", "DTIMESTOP", "DHITCOUNT" };
|
||||
editor.NextUndo();
|
||||
int l = 0;
|
||||
int h = editor.GetLineCount() - 1;
|
||||
int ll, hh;
|
||||
if(editor.GetSelection(ll, hh)) {
|
||||
l = editor.GetLine(ll);
|
||||
h = editor.GetLine(hh);
|
||||
}
|
||||
for(int i = h; i >= l; i--) {
|
||||
String ln = editor.GetUtf8Line(i);
|
||||
try {
|
||||
CParser p(ln);
|
||||
if(p.IsId()) {
|
||||
String id = p.ReadId();
|
||||
if(ds.Find(id) >= 0 && p.Char('(')) {
|
||||
int pos = editor.GetPos(i);
|
||||
int end = min(editor.GetLength(), editor.GetPos(i) + editor.GetLineLength(i) + 1);
|
||||
editor.Remove(editor.GetPos(i), end - pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(CParser::Error) {}
|
||||
}
|
||||
editor.GotoLine(l);
|
||||
}
|
||||
|
||||
void Ide::LaunchAndroidSDKManager(const AndroidSDK& androidSDK)
|
||||
{
|
||||
One<Host> host = CreateHost(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue