Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
23a5f173
Commit
23a5f173
authored
Sep 03, 2010
by
Roberto Raggi
Browse files
Check the traling text before inserting closing braces.
parent
2bbc9643
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmljseditor/qmljseditor.cpp
View file @
23a5f173
...
...
@@ -1684,8 +1684,15 @@ static bool shouldInsertNewline(const QTextCursor &tc)
QString
QmlJSTextEditor
::
insertParagraphSeparator
(
const
QTextCursor
&
tc
)
const
{
if
(
shouldInsertNewline
(
tc
))
if
(
shouldInsertNewline
(
tc
))
{
QTextCursor
cursor
=
tc
;
cursor
.
movePosition
(
QTextCursor
::
EndOfBlock
,
QTextCursor
::
KeepAnchor
);
if
(
!
cursor
.
selectedText
().
trimmed
().
isEmpty
())
return
QString
();
return
QLatin1String
(
"}
\n
"
);
}
return
QLatin1String
(
"}"
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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