Commit 2abd17ae authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed #kumir2-2039

parent 4b407f59
......@@ -577,7 +577,12 @@ void ToggleCommentCommand::redo()
else {
for (int i=fromLineInclusive; i<=toLineInclusive; i++) {
int dummy;
bool was_selection = doc->at(i).text.length() > 0 && doc->at(i).selected.first();
doc->insertText("| ", analizer, i, 0, dummy, dummy);
if (was_selection) {
doc->at(i).selected[0] = true;
doc->at(i).selected[1] = true;
}
commentedLines.insert(i);
}
}
......
......@@ -56,7 +56,7 @@ void TextDocument::insertText(const QString &text, const Shared::Analizer::Insta
// Insert text fragment into line
data_[line].text.insert(pos, lines[0]);
while (data_[line].selected.size() < data_[line].text.length())
data_[line].selected << false;
data_[line].selected.insert(pos, false);
while (data_[line].highlight.size() < data_[line].text.length())
data_[line].highlight << Shared::LxTypeEmpty;
if (analizer && AnalizerInterface::IndependentLinesHighlight==_syntaxHighlightBehaviour)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment