Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tobias Hunger
qt-creator
Commits
bf74d21d
Commit
bf74d21d
authored
Sep 22, 2009
by
Thorbjørn Lindeijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid completing a closing parenthesis in the wrong place
Need to check the character to the right of the cursor.
parent
7a920e46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/plugins/cppeditor/cppeditor.cpp
src/plugins/cppeditor/cppeditor.cpp
+0
-2
src/plugins/cpptools/cppcodecompletion.cpp
src/plugins/cpptools/cppcodecompletion.cpp
+8
-4
No files found.
src/plugins/cppeditor/cppeditor.cpp
View file @
bf74d21d
...
...
@@ -1862,5 +1862,3 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source)
return
semanticInfo
;
}
src/plugins/cpptools/cppcodecompletion.cpp
View file @
bf74d21d
...
...
@@ -46,6 +46,7 @@
#include <cplusplus/ResolveExpression.h>
#include <cplusplus/LookupContext.h>
#include <cplusplus/MatchingText.h>
#include <cplusplus/Overview.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/TokenUnderCursor.h>
...
...
@@ -1510,11 +1511,14 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
if
(
endWithSemicolon
)
extraChars
+=
QLatin1Char
(
';'
);
}
else
if
(
autoParenthesesEnabled
)
{
extraChars
+=
QLatin1Char
(
')'
);
--
cursorOffset
;
if
(
endWithSemicolon
)
{
extraChars
+=
QLatin1Char
(
';'
);
const
QChar
lookAhead
=
m_editor
->
characterAt
(
m_editor
->
position
()
+
1
);
if
(
MatchingText
::
shouldInsertMatchingText
(
lookAhead
))
{
extraChars
+=
QLatin1Char
(
')'
);
--
cursorOffset
;
if
(
endWithSemicolon
)
{
extraChars
+=
QLatin1Char
(
';'
);
--
cursorOffset
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment