From 7400557f8ca68c81bc903bb7e0622438780add77 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Fri, 7 May 2010 14:17:48 +0200 Subject: [PATCH] Fix in Utils::unCommentSelection to consider initial whites spaces when there's no selection and single line comment style. --- src/libs/utils/uncommentselection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libs/utils/uncommentselection.cpp b/src/libs/utils/uncommentselection.cpp index 06fe12ce31f..7c00ba22e7c 100644 --- a/src/libs/utils/uncommentselection.cpp +++ b/src/libs/utils/uncommentselection.cpp @@ -193,6 +193,15 @@ void Utils::unCommentSelection(QPlainTextEdit *edit, const CommentDefinition &de start = startBlock.position(); end = endBlock.position() + endBlock.length() - 1; + + if (doMultiLineStyleUncomment) { + int offset = 0; + text = startBlock.text(); + const int length = text.length(); + while (offset < length && text.at(offset).isSpace()) + ++offset; + start += offset; + } } if (doMultiLineStyleUncomment) {