核心编辑器组件升级到2.11

This commit is contained in:
爬山虎 2023-11-16 17:52:25 +08:00
parent e39e6014ee
commit ea55d37104
5 changed files with 41 additions and 12 deletions

View File

@ -358,7 +358,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
DrawMinus(surface, centreX, centreY, blobSize, colourTail);
surface->PenColour(colourHead);
surface->MoveTo(centreX, centreY + blobSize);
surface->MoveTo(centreX, centreY + blobSize + 1);
surface->LineTo(centreX, ircWhole.bottom);
}
@ -369,7 +369,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
DrawMinus(surface, centreX, centreY, blobSize, colourTail);
surface->PenColour(colourHead);
surface->MoveTo(centreX, centreY + blobSize);
surface->MoveTo(centreX, centreY + blobSize + 1);
surface->LineTo(centreX, ircWhole.bottom);
surface->PenColour(colourBody);

View File

@ -252,11 +252,13 @@ QVariant QsciScintillaBase::inputMethodQuery(Qt::InputMethodQuery query) const
{
int paraStart = sci->pdoc->ParaUp(pos);
int paraEnd = sci->pdoc->ParaDown(pos);
QVarLengthArray<char,1024> buffer(paraEnd - paraStart + 1);
// Sci_CharacterRange charRange;
// charRange.cpMin = paraStart;
// charRange.cpMax = paraEnd;
if (paraEnd - paraStart <= 0)
{
return "";
}
QByteArray buffer(paraEnd - paraStart + 1,0);
//QVarLengthArray<char,1024> buffer(paraEnd - paraStart + 1);
Sci_TextRange textRange;
textRange.chrg.cpMin = paraStart;

View File

@ -2234,6 +2234,10 @@ protected:
}
//识别中文UTF8字符的情况。
virtual bool startAutoWordCompletion(AutoCompletionSource acs, bool checkThresh,
bool choose_single);
private slots:
void handleCallTipClick(int dir);
void handleCharAdded(int charadded);

View File

@ -60,7 +60,7 @@ QColor QsciLexerJSON::defaultColor(int style) const
{
case UnclosedString:
case Error:
return QColor(0xff, 0xff, 0xff);
return QColor(0x0, 0x0, 0x0);
case Number:
return QColor(0x00, 0x7f, 0x7f);

View File

@ -261,6 +261,14 @@ void QsciScintilla::handleCharAdded(int ch)
return;
}
else if (isListActive() && ch > 0x80)
{
cancelList();
//不是ascii字符是中文UTF8的情况。
//识别中文Utf8字符。
startAutoWordCompletion(acSource, false, use_single == AcusAlways);
return;
}
// Handle call tips.
if (call_tips_style != CallTipsNone && !lex.isNull() && strchr("(),", ch) != NULL)
@ -282,8 +290,14 @@ void QsciScintilla::handleCharAdded(int ch)
startAutoCompletion(acSource, false, use_single == AcusAlways);
else if (acThresh >= 1 && isWordCharacter(ch))
startAutoCompletion(acSource, true, use_single == AcusAlways);
else if(ch > 0x80)
{
//不是ascii字符是中文UTF8的情况。
//识别中文Utf8字符。
startAutoWordCompletion(acSource, false, use_single == AcusAlways);
}
}
}
// See if a call tip is active.
@ -786,6 +800,15 @@ void QsciScintilla::startAutoCompletion(AutoCompletionSource acs,
}
//放在子类中去完成。
bool QsciScintilla::startAutoWordCompletion(AutoCompletionSource acs,
bool checkThresh, bool choose_single)
{
return false;
}
// Maintain the indentation of the previous line.
void QsciScintilla::maintainIndentation(char ch, long pos)
{