Skip to content
GitLab
Menu
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
62705df6
Commit
62705df6
authored
Feb 03, 2010
by
Erik Verbruggen
Browse files
Moved indentation utility method from CPPEditor into BaseTextEditor.
Reviewed-by: Roberto Raggi
parent
85ff8c22
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
62705df6
...
@@ -1561,11 +1561,6 @@ bool CPPEditor::isInComment(const QTextCursor &cursor) const
...
@@ -1561,11 +1561,6 @@ bool CPPEditor::isInComment(const QTextCursor &cursor) const
return
false
;
return
false
;
}
}
void
CPPEditor
::
indentInsertedText
(
const
QTextCursor
&
tc
)
{
indent
(
tc
.
document
(),
tc
,
QChar
::
Null
);
}
// Indent a code line based on previous
// Indent a code line based on previous
template
<
class
Iterator
>
template
<
class
Iterator
>
static
void
indentCPPBlock
(
const
CPPEditor
::
TabSettings
&
ts
,
static
void
indentCPPBlock
(
const
CPPEditor
::
TabSettings
&
ts
,
...
...
src/plugins/cppeditor/cppeditor.h
View file @
62705df6
...
@@ -186,8 +186,6 @@ public:
...
@@ -186,8 +186,6 @@ public:
~
CPPEditor
();
~
CPPEditor
();
void
unCommentSelection
();
void
unCommentSelection
();
void
indentInsertedText
(
const
QTextCursor
&
tc
);
unsigned
editorRevision
()
const
;
unsigned
editorRevision
()
const
;
bool
isOutdated
()
const
;
bool
isOutdated
()
const
;
SemanticInfo
semanticInfo
()
const
;
SemanticInfo
semanticInfo
()
const
;
...
...
src/plugins/texteditor/basetexteditor.cpp
View file @
62705df6
...
@@ -3803,6 +3803,11 @@ bool BaseTextEditor::isElectricCharacter(const QChar &) const
...
@@ -3803,6 +3803,11 @@ bool BaseTextEditor::isElectricCharacter(const QChar &) const
return
false
;
return
false
;
}
}
void
BaseTextEditor
::
indentInsertedText
(
const
QTextCursor
&
tc
)
{
indent
(
tc
.
document
(),
tc
,
QChar
::
Null
);
}
void
BaseTextEditor
::
countBracket
(
QChar
open
,
QChar
close
,
QChar
c
,
int
*
errors
,
int
*
stillopen
)
void
BaseTextEditor
::
countBracket
(
QChar
open
,
QChar
close
,
QChar
c
,
int
*
errors
,
int
*
stillopen
)
{
{
if
(
c
==
open
)
if
(
c
==
open
)
...
...
src/plugins/texteditor/basetexteditor.h
View file @
62705df6
...
@@ -533,6 +533,9 @@ protected:
...
@@ -533,6 +533,9 @@ protected:
public:
public:
// Returns true if key triggers an indent.
// Returns true if key triggers an indent.
virtual
bool
isElectricCharacter
(
const
QChar
&
ch
)
const
;
virtual
bool
isElectricCharacter
(
const
QChar
&
ch
)
const
;
void
indentInsertedText
(
const
QTextCursor
&
tc
);
protected:
protected:
// Returns the text to complete at the cursor position, or an empty string
// Returns the text to complete at the cursor position, or an empty string
virtual
QString
autoComplete
(
QTextCursor
&
cursor
,
const
QString
&
text
)
const
;
virtual
QString
autoComplete
(
QTextCursor
&
cursor
,
const
QString
&
text
)
const
;
...
...
Write
Preview
Supports
Markdown
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