Mercurial > hg > octave-terminal
changeset 13487:0c896eff7a80
Removed annoying debug messages from the text editor.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Wed, 27 Apr 2011 15:34:01 +0200 |
parents | 68a13d4f6e15 |
children | fc754f56453e |
files | gui//src/BlockArray.cpp gui//src/NumberedCodeEdit.cpp gui//src/SimpleEditor.cpp gui//src/SyntaxHighlighter.cpp gui//src/TerminalDisplay.cpp |
diffstat | 5 files changed, 4 insertions(+), 55 deletions(-) [+] |
line wrap: on
line diff
--- a/gui//src/BlockArray.cpp +++ b/gui//src/BlockArray.cpp @@ -218,7 +218,6 @@ res = fwrite(buffer2, blocksize, 1, fion); if (res != 1) perror("fwrite"); - // printf("moving block %d to %d\n", cursor, newpos); } void BlockArray::decreaseBuffer(size_t newsize)
--- a/gui//src/NumberedCodeEdit.cpp +++ b/gui//src/NumberedCodeEdit.cpp @@ -419,19 +419,6 @@ return false; } - /*if(get_config("simple_rcs")=="true") - { - QString repository=path+"~~"; - QString command("simplercs \""+repository+"\" \""+path+"\""); - QProcess::startDetached(command); - //QProcess::execute(command); - printf("[NumberedTextView::save] Comando: %s\n", command.toLocal8Bit().data() ); - } - else - { - //printf("[NumberedTextView::save] No rcs\n"); - }*/ - return true; } @@ -485,8 +472,7 @@ } QString s1=s.left(x); - QString s2=s.right(s.size()-x); - //printf("s1=%s s2=%s\n", s1.toLocal8Bit().data(), s2.toLocal8Bit().data() ); + QString s2=s.right(s.size()-x); list[i]=s1+textToInsert+s2; } @@ -496,7 +482,6 @@ static QString startLineRemoveText(QString str, QStringList textToRemove) { str.replace(QChar(0x2029), "\n"); - //printf("str=%s\n", str.toLocal8Bit().data() ); QStringList list = str.split("\n"); @@ -537,8 +522,6 @@ void NumberedCodeEdit::indent() { - //QTextDocument *doc=textEdit()->document(); - QTextCursor cursor(textEdit()->textCursor()); if( !cursor.hasSelection() ) return;
--- a/gui//src/SimpleEditor.cpp +++ b/gui//src/SimpleEditor.cpp @@ -144,7 +144,6 @@ cursor.insertText("\n" + line); if(m_automaticIndentationStatement) { - printf("[SimpleEditor::keyPressEvent] automatic_indention_statement_ok=%s\n", line2.toLocal8Bit().data() ); QRegExp re("^while .*|^if .*|^for .*|^switch .*|^do$|^try|^function .*|^else$|^elseif .*"); if(re.exactMatch(line2.trimmed())) { cursor.insertText("\t");
--- a/gui//src/SyntaxHighlighter.cpp +++ b/gui//src/SyntaxHighlighter.cpp @@ -34,7 +34,6 @@ QStack <QString> stack; QFile fileDevice(file); if (!fileDevice.open(QFile::ReadOnly | QFile::Text)) { - printf("Error al abrir el archivo\n"); return false; } @@ -119,7 +118,6 @@ QRegExp *expression = &(rule->pattern); int index = rule->lastFound; - //printf("[Syntax::highlight1stRule] i=%d pos=%d startIndex=%d\n", i, index, startIndex); if(index>-1 && index<startIndex) { rule->lastFound = index = expression->indexIn(text, startIndex); @@ -219,9 +217,6 @@ startIndex=index+bracket.length; insertInOrder(blockData, bracket); - - //printf("[Syntax::findBrackets] bracket.pos=%d bracket.type=%d bracket.len=%d bracket.start=%d startIndex=%d\n", bracket.pos, bracket.type, bracket.length, (bracket.startBracketOk), startIndex ); - index = rule.startPattern.indexIn(text, startIndex); } @@ -314,20 +309,12 @@ HighlightingRule *rule= &(highlightingRules[i]); QRegExp *expression = &(rule->pattern); int index = expression->indexIn(text, startIndex); - rule->lastFound = index; - //printf("[Syntax::highlightBlock] index=%d pos=%d \n", index, expression->pos(0)); + rule->lastFound = index; } - - //printf("[Syntax::highlightBlock] Find initial matches \n"); - + rule1st=highlight1stRule( text, startIndex); blockRule1st=highlight1stBlockRule( text, startIndex); - - //if(rule1st.rule<0 && blockRule1st.rule<0) - //{ - // findBrackets(text, startIndex, -1, blockData); - //} - //else + while(rule1st.rule>=0 || blockRule1st.rule>=0) { if(rule1st.rule>=0 && blockRule1st.rule>=0) @@ -366,10 +353,6 @@ startIndex=blockRuleSetFormat(text,blockRule1st); blockRule1st=highlight1stBlockRule( text, startIndex); } - - //Finds next 1st rule - //rule1st=highlight1stRule( text, startIndex); - //blockRule1st=highlight1stBlockRule( text, startIndex); } findBrackets(text,startIndex, -1, blockData); @@ -421,17 +404,6 @@ QTextBlock block_bracket1=block; int i=blockData->brackets.size()-1; - - /* - printf("[Syntax::setFormatPairBrackets] brackets.size=%d\n", i+1); - for(int x=0;x<blockData->brackets.size();x++) - { - BlockData::Bracket *bracket=&(blockData->brackets[x]); - printf("[Syntax::setFormatPairBrackets] bracket.pos=%d bracket.type=%d bracket.len=%d bracket.start=%d\n", bracket->pos, bracket->type, bracket->length, (bracket->startBracketOk) ); - } - */ - - for(; i>=0; i--) { BlockData::Bracket *bracket=&(blockData->brackets[i]); @@ -446,8 +418,6 @@ int increment=(bracket1->startBracketOk) ? +1:-1; int bracketsCount=0; - //i+=increment; - //Looks in this block the other bracket BlockData::Bracket *bracket2=NULL; QTextBlock block_bracket2=block;
--- a/gui//src/TerminalDisplay.cpp +++ b/gui//src/TerminalDisplay.cpp @@ -746,8 +746,6 @@ int xpos, ypos; ypos = _topMargin + tLy + _fontHeight*(cury-1) + _fontAscent; xpos = _leftMargin + tLx + _fontWidth*curx; - //setMicroFocusHint(xpos, ypos, 0, _fontHeight); //### ??? - // fprintf(stderr, "x/y = %d/%d\txpos/ypos = %d/%d\n", curx, cury, xpos, ypos); _cursorLine = cury; _cursorCol = curx; }