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
ea5d923f
Commit
ea5d923f
authored
Dec 14, 2010
by
Roberto Raggi
Browse files
Don't waste time rehighlighting all the files opened in Creator.
parent
6e17e7a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmljseditor/qmljseditor.cpp
View file @
ea5d923f
...
...
@@ -803,9 +803,6 @@ void QmlJSTextEditor::onDocumentUpdated(QmlJS::Document::Ptr doc)
{
if
(
file
()
->
fileName
()
!=
doc
->
fileName
()
||
doc
->
editorRevision
()
!=
document
()
->
revision
())
{
// didn't get the currently open, or an up to date document.
// trigger a semantic rehighlight anyway, after a time
m_semanticRehighlightTimer
->
start
();
return
;
}
...
...
src/plugins/qmljseditor/qmljseditor.h
View file @
ea5d923f
...
...
@@ -158,6 +158,7 @@ public:
static
QVector
<
QString
>
highlighterFormatCategories
();
public
slots
:
void
forceSemanticRehighlight
();
void
followSymbolUnderCursor
();
void
findUsages
();
void
showContextPane
();
...
...
@@ -187,7 +188,6 @@ private slots:
void
renameIdUnderCursor
();
void
semanticRehighlight
();
void
forceSemanticRehighlight
();
void
updateSemanticInfo
(
const
QmlJSEditor
::
SemanticInfo
&
semanticInfo
);
void
onCursorPositionChanged
();
void
onRefactorMarkerClicked
(
const
TextEditor
::
RefactorMarker
&
marker
);
...
...
src/plugins/qmljseditor/qmljseditorplugin.cpp
View file @
ea5d923f
...
...
@@ -241,6 +241,8 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
addAutoReleasedObject
(
new
QuickToolBar
);
addAutoReleasedObject
(
new
Internal
::
QuickToolBarSettingsPage
);
connect
(
core
->
editorManager
(),
SIGNAL
(
currentEditorChanged
(
Core
::
IEditor
*
)),
SLOT
(
currentEditorChanged
(
Core
::
IEditor
*
)));
return
true
;
}
...
...
@@ -340,4 +342,14 @@ void QmlJSEditorPlugin::quickFixNow()
}
}
void
QmlJSEditorPlugin
::
currentEditorChanged
(
Core
::
IEditor
*
editor
)
{
if
(
!
editor
)
return
;
else
if
(
QmlJSTextEditor
*
textEditor
=
qobject_cast
<
QmlJSTextEditor
*>
(
editor
->
widget
()))
{
textEditor
->
forceSemanticRehighlight
();
}
}
Q_EXPORT_PLUGIN
(
QmlJSEditorPlugin
)
src/plugins/qmljseditor/qmljseditorplugin.h
View file @
ea5d923f
...
...
@@ -45,6 +45,7 @@ namespace Core {
class
Command
;
class
ActionContainer
;
class
ActionManager
;
class
IEditor
;
}
namespace
TextEditor
{
...
...
@@ -95,6 +96,7 @@ public Q_SLOTS:
private
Q_SLOTS
:
void
quickFix
(
TextEditor
::
ITextEditable
*
editable
);
void
quickFixNow
();
void
currentEditorChanged
(
Core
::
IEditor
*
editor
);
private:
Core
::
Command
*
addToolAction
(
QAction
*
a
,
Core
::
ActionManager
*
am
,
Core
::
Context
&
context
,
const
QString
&
name
,
...
...
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