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
Marco Bubke
flatpak-qt-creator
Commits
f6482a38
Commit
f6482a38
authored
Jan 21, 2010
by
Martin Aumüller
Committed by
hjk
Jan 21, 2010
Browse files
fakevim: implement incremental backward search '?' using Find plugin
Merge-request: 97 Reviewed-by:
hjk
<
qtc-committer@nokia.com
>
parent
474d883e
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/plugins/bineditor/bineditorplugin.cpp
View file @
f6482a38
...
...
@@ -103,7 +103,6 @@ public:
m_incrementalStartPos
=
m_editor
->
selectionStart
();
if
(
m_contPos
==
-
1
)
m_contPos
=
m_incrementalStartPos
;
findFlags
&=
~
Find
::
IFindSupport
::
FindBackward
;
int
found
=
find
(
pattern
,
m_contPos
,
findFlags
);
Result
result
;
if
(
found
>=
0
)
{
...
...
src/plugins/fakevim/fakevimplugin.cpp
View file @
f6482a38
...
...
@@ -416,10 +416,12 @@ void FakeVimPluginPrivate::windowCommand(int key)
void
FakeVimPluginPrivate
::
find
(
bool
reverse
)
{
Q_UNUSED
(
reverse
)
// TODO: Creator needs an action for find in reverse.
if
(
Find
::
Internal
::
FindPlugin
::
instance
())
Find
::
Internal
::
FindPlugin
::
instance
()
->
setUseFakeVim
(
true
);
triggerAction
(
Find
::
Constants
::
FIND_IN_DOCUMENT
);
if
(
Find
::
Internal
::
FindPlugin
*
plugin
=
Find
::
Internal
::
FindPlugin
::
instance
())
{
plugin
->
setUseFakeVim
(
true
);
plugin
->
openFindToolBar
(
reverse
?
Find
::
Internal
::
FindPlugin
::
FindBackward
:
Find
::
Internal
::
FindPlugin
::
FindForward
);
}
}
void
FakeVimPluginPrivate
::
findNext
(
bool
reverse
)
...
...
src/plugins/find/basetextfind.cpp
View file @
f6482a38
...
...
@@ -132,7 +132,6 @@ IFindSupport::Result BaseTextFind::findIncremental(const QString &txt, IFindSupp
if
(
m_incrementalStartPos
<
0
)
m_incrementalStartPos
=
cursor
.
selectionStart
();
cursor
.
setPosition
(
m_incrementalStartPos
);
findFlags
&=
~
IFindSupport
::
FindBackward
;
bool
found
=
find
(
txt
,
findFlags
,
cursor
);
if
(
found
)
emit
highlightAll
(
txt
,
findFlags
);
...
...
src/plugins/find/findplugin.cpp
View file @
f6482a38
...
...
@@ -314,4 +314,12 @@ void FindPlugin::setUseFakeVim(bool on)
m_findToolBar
->
setUseFakeVim
(
on
);
}
void
FindPlugin
::
openFindToolBar
(
FindDirection
direction
)
{
if
(
m_findToolBar
)
{
m_findToolBar
->
setBackward
(
direction
==
FindBackward
);
m_findToolBar
->
openFindToolBar
();
}
}
Q_EXPORT_PLUGIN
(
FindPlugin
)
src/plugins/find/findplugin.h
View file @
f6482a38
...
...
@@ -56,6 +56,11 @@ public:
virtual
~
FindPlugin
();
static
FindPlugin
*
instance
();
enum
FindDirection
{
FindForward
,
FindBackward
};
// IPlugin
bool
initialize
(
const
QStringList
&
arguments
,
QString
*
error_message
);
void
extensionsInitialized
();
...
...
@@ -67,6 +72,7 @@ public:
QStringListModel
*
findCompletionModel
()
{
return
m_findCompletionModel
;
}
QStringListModel
*
replaceCompletionModel
()
{
return
m_replaceCompletionModel
;
}
void
setUseFakeVim
(
bool
on
);
void
openFindToolBar
(
FindDirection
direction
);
public
slots
:
void
setCaseSensitive
(
bool
sensitive
);
...
...
src/plugins/find/findtoolbar.cpp
View file @
f6482a38
...
...
@@ -571,6 +571,12 @@ Core::FindToolBarPlaceHolder *FindToolBar::findToolBarPlaceHolder() const
}
void
FindToolBar
::
openFind
()
{
setBackward
(
false
);
openFindToolBar
();
}
void
FindToolBar
::
openFindToolBar
()
{
if
(
!
m_currentDocumentFind
->
candidateIsEnabled
())
return
;
...
...
@@ -676,3 +682,8 @@ void FindToolBar::setRegularExpressions(bool regexp)
{
setFindFlag
(
IFindSupport
::
FindRegularExpression
,
regexp
);
}
void
FindToolBar
::
setBackward
(
bool
backward
)
{
setFindFlag
(
IFindSupport
::
FindBackward
,
backward
);
}
src/plugins/find/findtoolbar.h
View file @
f6482a38
...
...
@@ -50,6 +50,7 @@ class FindPlugin;
class
FindToolBar
:
public
Utils
::
StyledBar
{
friend
class
FindPlugin
;
Q_OBJECT
public:
...
...
@@ -86,6 +87,7 @@ private slots:
void
setCaseSensitive
(
bool
sensitive
);
void
setWholeWord
(
bool
wholeOnly
);
void
setRegularExpressions
(
bool
regexp
);
void
setBackward
(
bool
backward
);
void
adaptToCandidate
();
...
...
@@ -93,6 +95,7 @@ protected:
bool
focusNextPrevChild
(
bool
next
);
private:
void
openFindToolBar
();
void
invokeClearResults
();
bool
setFocusToCurrentFindSupport
();
void
setFindFlag
(
IFindSupport
::
FindFlag
flag
,
bool
enabled
);
...
...
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