mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-15 22:02:51 -06:00
ide: Ids completion, X11: removed DLOGs
git-svn-id: svn://ultimatepp.org/upp/trunk@6599 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
425f43f05e
commit
04dd18097a
6 changed files with 47 additions and 7 deletions
|
|
@ -2,8 +2,13 @@
|
|||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
AKD_TEST
|
||||
Ctrl::AddFlags(Ctrl::AKD_CONSERVATIVE);
|
||||
AccessKey().Run(Accept());
|
||||
String s;
|
||||
s.Cat()
|
||||
String s;S
|
||||
s.Cat()Add
|
||||
|
||||
AKD_CONS
|
||||
|
||||
AKD_TEST
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,14 +229,12 @@ void SystemDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font fon
|
|||
}
|
||||
else {
|
||||
// if(dx) {
|
||||
DLOG("------------");
|
||||
int xpos = ox;
|
||||
Buffer<XftCharSpec> ch(n);
|
||||
for(int i = 0; i < n; i++) {
|
||||
ch[i].ucs4 = text[i];
|
||||
ch[i].x = xpos;
|
||||
ch[i].y = oy + ascent;
|
||||
DLOG((char)text[i] << ", " << font[text[i]] << ", " << xpos);
|
||||
xpos += dx ? dx[i] : font[text[i]];
|
||||
}
|
||||
XftDrawCharSpec(xftdraw, &c, xftfont, ch, n);
|
||||
|
|
|
|||
|
|
@ -534,9 +534,8 @@ void AssistEditor::PopUpAssist(bool auto_insert)
|
|||
popup.Ctrl::PopUp(this, false, false, true);
|
||||
}
|
||||
|
||||
void AssistEditor::Complete()
|
||||
Vector<String> AssistEditor::GetFileIds()
|
||||
{
|
||||
CloseAssist();
|
||||
Index<String> id;
|
||||
int l = GetCursorLine() - 1;
|
||||
while(l >= 0) {
|
||||
|
|
@ -549,6 +548,13 @@ void AssistEditor::Complete()
|
|||
p.SkipTerm();
|
||||
l--;
|
||||
}
|
||||
return id.PickKeys();
|
||||
}
|
||||
|
||||
void AssistEditor::Complete()
|
||||
{
|
||||
CloseAssist();
|
||||
Vector<String> id = GetFileIds();
|
||||
for(int i = 0; i < id.GetCount(); i++) {
|
||||
CppItemInfo& f = assist_item.Add(id[i]);
|
||||
f.name = id[i];
|
||||
|
|
@ -560,6 +566,33 @@ void AssistEditor::Complete()
|
|||
PopUpAssist(true);
|
||||
}
|
||||
|
||||
void AssistEditor::Complete2()
|
||||
{
|
||||
CloseAssist();
|
||||
int c = GetCursor();
|
||||
String q = IdBack(c);
|
||||
if(IsNull(q))
|
||||
return;
|
||||
String h;
|
||||
Vector<String> id = GetFileIds();
|
||||
for(int i = 0; i < id.GetCount(); i++) {
|
||||
String s = id[i];
|
||||
if(s.StartsWith(q))
|
||||
if(IsNull(h))
|
||||
h = s;
|
||||
else {
|
||||
s.Trim(min(s.GetCount(), h.GetCount()));
|
||||
for(int j = 0; j < s.GetCount(); j++)
|
||||
if(s[j] != h[j]) {
|
||||
h.Trim(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(h.GetCount() > q.GetCount())
|
||||
Paste(h.Mid(q.GetCount()).ToWString());
|
||||
}
|
||||
|
||||
void AssistEditor::Abbr()
|
||||
{
|
||||
CloseAssist();
|
||||
|
|
|
|||
|
|
@ -367,7 +367,9 @@ struct AssistEditor : CodeEditor {
|
|||
void SyncParamInfo();
|
||||
void StartParamInfo(const CppItem& m, int pos);
|
||||
|
||||
Vector<String> GetFileIds();
|
||||
void Complete();
|
||||
void Complete2();
|
||||
void Abbr();
|
||||
|
||||
void Context(Parser& parser, int pos);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,8 @@ KEY(CLEARMARKERSALL, "Remove all change markers", K_SHIFT|K_ALT_R)
|
|||
KEY(TOGGLEINDEX, "File index", K_CTRL_F12)
|
||||
KEY(SEARCHINDEX, "File index search", K_F12)
|
||||
KEY2(SEARCHCODE, "Search symbol", K_CTRL_U, K_CTRL_Y|K_SHIFT)
|
||||
KEY(COMPLETE, "Complete identifier", K_CTRL_COMMA)
|
||||
KEY(COMPLETE, "Complete identifier with list", K_CTRL_COMMA)
|
||||
KEY(COMPLETE2, "Complete identifier", K_CTRL_M)
|
||||
|
||||
KEY(TOUPPER, "To uppercase", 0)
|
||||
KEY(TOLOWER, "To lowercase", 0)
|
||||
|
|
|
|||
|
|
@ -515,6 +515,7 @@ void Ide::BrowseMenu(Bar& menu) {
|
|||
menu.Add(!designer, AK_VIRTUALS, callback(&editor, &AssistEditor::Virtuals));
|
||||
menu.Add(!designer, AK_THISBACKS, callback(&editor, &AssistEditor::Thisbacks));
|
||||
menu.Add(!designer, AK_COMPLETE, callback(&editor, &AssistEditor::Complete));
|
||||
menu.Add(!designer, AK_COMPLETE2, callback(&editor, &AssistEditor::Complete2));
|
||||
menu.Add(!designer, AK_ABBR, callback(&editor, &AssistEditor::Abbr));
|
||||
menu.Add(!designer, "Insert", THISBACK(InsertMenu));
|
||||
menu.MenuSeparator();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue