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
839c30f8
Commit
839c30f8
authored
Jan 14, 2011
by
con
Browse files
Text document search was showing wrap indicator too often.
parent
051011bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/find/basetextfind.cpp
View file @
839c30f8
...
...
@@ -183,7 +183,7 @@ IFindSupport::Result BaseTextFind::findIncremental(const QString &txt, Find::Fin
cursor
.
setPosition
(
d
->
m_incrementalStartPos
);
bool
wrapped
=
false
;
bool
found
=
find
(
txt
,
findFlags
,
cursor
,
&
wrapped
);
if
(
wrapped
!=
d
->
m_incrementalWrappedState
)
{
if
(
wrapped
!=
d
->
m_incrementalWrappedState
&&
found
)
{
d
->
m_incrementalWrappedState
=
wrapped
;
showWrapIndicator
(
d
->
m_widget
);
}
...
...
@@ -292,8 +292,6 @@ bool BaseTextFind::find(const QString &txt,
// scoped
if
(
found
.
isNull
()
||
!
inScope
(
found
.
selectionStart
(),
found
.
selectionEnd
()))
{
if
(
wrapped
)
*
wrapped
=
true
;
if
((
findFlags
&
Find
::
FindBackward
)
==
0
)
start
.
setPosition
(
d
->
m_findScopeStart
.
position
());
else
...
...
@@ -301,21 +299,22 @@ bool BaseTextFind::find(const QString &txt,
found
=
findOne
(
regexp
,
start
,
Find
::
textDocumentFlagsForFindFlags
(
findFlags
));
if
(
found
.
isNull
()
||
!
inScope
(
found
.
selectionStart
(),
found
.
selectionEnd
()))
return
false
;
if
(
wrapped
)
*
wrapped
=
true
;
}
}
else
{
// entire document
if
(
found
.
isNull
())
{
if
(
wrapped
)
*
wrapped
=
true
;
if
((
findFlags
&
Find
::
FindBackward
)
==
0
)
start
.
movePosition
(
QTextCursor
::
Start
);
else
start
.
movePosition
(
QTextCursor
::
End
);
found
=
findOne
(
regexp
,
start
,
Find
::
textDocumentFlagsForFindFlags
(
findFlags
));
if
(
found
.
isNull
())
{
if
(
found
.
isNull
())
return
false
;
}
if
(
wrapped
)
*
wrapped
=
true
;
}
}
if
(
!
found
.
isNull
())
{
...
...
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