- fix: calculation for code snippets's tab stop positions is not correct
This commit is contained in:
parent
4cf9c2845a
commit
4c8bed0445
|
@ -2606,12 +2606,12 @@ void Editor::insertCodeSnippet(const QString &code)
|
|||
});
|
||||
QStringList sl = textToLines(parseMacros(code));
|
||||
int lastI=0;
|
||||
int spaceCount = GetLeftSpacing(
|
||||
leftSpaces(lineText()),true).length();
|
||||
// int spaceCount = GetLeftSpacing(
|
||||
// leftSpaces(lineText()),true).length();
|
||||
QStringList newSl;
|
||||
for (int i=0;i<sl.count();i++) {
|
||||
int lastPos = 0;
|
||||
QString s = sl[i].trimmed();
|
||||
QString s = sl[i];
|
||||
if (i>0)
|
||||
lastPos = countLeadingWhitespaceChars(s);
|
||||
while (true) {
|
||||
|
|
|
@ -174,6 +174,12 @@ QList<QByteArray> splitByteArrayToLines(const QByteArray& content);
|
|||
|
||||
QString parseMacros(const QString& s);
|
||||
|
||||
/**
|
||||
* @brief readFileToLines
|
||||
* @param fileName
|
||||
* @param codec
|
||||
* @return
|
||||
*/
|
||||
QStringList readFileToLines(const QString& fileName, QTextCodec* codec);
|
||||
QStringList readFileToLines(const QString& fileName);
|
||||
QByteArray readFileToByteArray(const QString& fileName);
|
||||
|
|
Loading…
Reference in New Issue