work save
This commit is contained in:
parent
f8fae59dcc
commit
ddbd302af3
|
@ -390,6 +390,7 @@ void Editor::keyPressEvent(QKeyEvent *event)
|
||||||
setSelText(ch);
|
setSelText(ch);
|
||||||
showCompletion(false);
|
showCompletion(false);
|
||||||
handled=true;
|
handled=true;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,7 +435,7 @@ void Editor::keyPressEvent(QKeyEvent *event)
|
||||||
|
|
||||||
// Spawn code completion window if we are allowed to
|
// Spawn code completion window if we are allowed to
|
||||||
// if devCodeCompletion.Enabled then begin
|
// if devCodeCompletion.Enabled then begin
|
||||||
handleCodeCompletion(ch);
|
handled = handleCodeCompletion(ch);
|
||||||
// end;
|
// end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1143,29 +1144,36 @@ bool Editor::handleGlobalIncludeSkip()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::handleCodeCompletion(QChar key)
|
bool Editor::handleCodeCompletion(QChar key)
|
||||||
{
|
{
|
||||||
if (!mCompletionPopup->isEnabled())
|
if (!mCompletionPopup->isEnabled())
|
||||||
return;
|
return false;
|
||||||
switch(key.unicode()) {
|
switch(key.unicode()) {
|
||||||
case '.':
|
case '.':
|
||||||
|
setSelText(key);
|
||||||
showCompletion(false);
|
showCompletion(false);
|
||||||
break;
|
return true;
|
||||||
case '>':
|
case '>':
|
||||||
|
setSelText(key);
|
||||||
if ((caretX() > 1) && (lineText().length() >= 1) &&
|
if ((caretX() > 1) && (lineText().length() >= 1) &&
|
||||||
(lineText()[caretX() - 2] == '-'))
|
(lineText()[caretX() - 2] == '-'))
|
||||||
showCompletion(false);
|
showCompletion(false);
|
||||||
break;
|
return true;
|
||||||
case ':':
|
case ':':
|
||||||
|
setSelText(key);
|
||||||
if ((caretX() > 1) && (lineText().length() >= 1) &&
|
if ((caretX() > 1) && (lineText().length() >= 1) &&
|
||||||
(lineText()[caretX() - 2] == ':'))
|
(lineText()[caretX() - 2] == ':'))
|
||||||
showCompletion(false);
|
showCompletion(false);
|
||||||
break;
|
return true;
|
||||||
case '/':
|
case '/':
|
||||||
case '\\':
|
case '\\':
|
||||||
|
setSelText(key);
|
||||||
if (mParser->isIncludeLine(lineText())) {
|
if (mParser->isIncludeLine(lineText())) {
|
||||||
showHeaderCompletion(false);
|
showHeaderCompletion(false);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1683,7 +1691,7 @@ QString Editor::getWordAtPosition(const BufferCoord &p, BufferCoord &pWordBegin,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get end result
|
// Get end result
|
||||||
result = s.mid(wordBegin + 1, wordEnd - wordBegin);
|
result = s.mid(wordBegin+1, wordEnd - wordBegin);
|
||||||
pWordBegin.Line = p.Line;
|
pWordBegin.Line = p.Line;
|
||||||
pWordBegin.Char = wordBegin+1;
|
pWordBegin.Char = wordBegin+1;
|
||||||
pWordEnd.Line = p.Line;
|
pWordEnd.Line = p.Line;
|
||||||
|
|
|
@ -156,7 +156,7 @@ private:
|
||||||
bool handleGlobalIncludeCompletion();
|
bool handleGlobalIncludeCompletion();
|
||||||
bool handleGlobalIncludeSkip();
|
bool handleGlobalIncludeSkip();
|
||||||
|
|
||||||
void handleCodeCompletion(QChar key);
|
bool handleCodeCompletion(QChar key);
|
||||||
void initParser();
|
void initParser();
|
||||||
void undoSymbolCompletion(int pos);
|
void undoSymbolCompletion(int pos);
|
||||||
QuoteStatus getQuoteStatus();
|
QuoteStatus getQuoteStatus();
|
||||||
|
|
|
@ -820,7 +820,7 @@ void SynEditCppHighlighter::pointProc()
|
||||||
if (mLine[mRun+1] == '.' && mLine[mRun+2] == '.') {
|
if (mLine[mRun+1] == '.' && mLine[mRun+2] == '.') {
|
||||||
mRun+=3;
|
mRun+=3;
|
||||||
mExtTokenId = ExtTokenKind::Ellipse;
|
mExtTokenId = ExtTokenKind::Ellipse;
|
||||||
} else if (mLine[mRun+1]>=0 && mLine[mRun+1]<='9') {
|
} else if (mLine[mRun+1]>='0' && mLine[mRun+1]<='9') {
|
||||||
numberProc();
|
numberProc();
|
||||||
} else {
|
} else {
|
||||||
mRun+=1;
|
mRun+=1;
|
||||||
|
@ -1538,6 +1538,8 @@ SynHighlighterTokenType SynEditCppHighlighter::getTokenType()
|
||||||
return SynHighlighterTokenType::Character;
|
return SynHighlighterTokenType::Character;
|
||||||
case TokenKind::Symbol:
|
case TokenKind::Symbol:
|
||||||
return SynHighlighterTokenType::Symbol;
|
return SynHighlighterTokenType::Symbol;
|
||||||
|
case TokenKind::Number:
|
||||||
|
return SynHighlighterTokenType::Number;
|
||||||
default:
|
default:
|
||||||
return SynHighlighterTokenType::Default;
|
return SynHighlighterTokenType::Default;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue