Commit Graph

176 Commits

Author SHA1 Message Date
Marcus Tillmanns
cf81ff2a29 texteditor: Add Select Next Match function
Adds an Action to select the next occurrence(s) of the currently selected text.

Change-Id: I37e23a3c2d1651ec4898fac53d75044d92ed7079
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-13 12:58:09 +00:00
Knud Dollereder
2fa63a2801 Fix QKeySequence construction on macOS
Constructing a QKeySequence with the string "Cmd+Opt+Shift+V" leads
to an invalid, non-empty QKeySequence when compiling Design Studio
on macOS. This triggers an assertion later in the code path.
Using “Ctrl+Alt+Shift+V” instead works as expected.

Change-Id: I7cb185d18f9ffbb7454c61f28a93cdd307121882
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-04 13:30:20 +00:00
Leena Miettinen
33c8c31dd8 Text Editor: Fix UI text capitalization
Change-Id: I888cfb4eb8c3b5934b45dcf80d751fb97d8f7624
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-18 10:24:46 +00:00
David Schulz
955e2b2296 TextEditor: only track actions which are updated
Change-Id: I323e8a9c0a8088d9c6ab338b32a225a228bd7061
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-13 14:02:08 +00:00
David Schulz
c5c3214cfb TextEditor: add action to paste without autoFormat
Fixes: QTCREATORBUG-20887
Change-Id: Iedc6b584c9c1cc48804025653d0749e054a406f8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-24 12:20:05 +00:00
David Schulz
0198aca205 Editor: set deleteStartOfLine default shortcut on mac
Fixes: QTCREATORBUG-9219
Change-Id: I26f991641efbc914d848591931756666e34c26b7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-17 09:44:09 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
David Schulz
aaa1376576 Editor: Allow setting the optional action mask per editor
Instead of just enable actions that were disabled from the beginning you
can no disable optional actions.

Change-Id: I986b8a72523a8aeec9f4ccf76cd4921018ffc003
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-17 09:47:44 +00:00
David Schulz
5f91985931 Editor: enable optional actions per editor
Use an additional action mask to enable actions like find usage and
rename symbol per editor instance.

Change-Id: Iabee1820d0f3c156ad30ba760bfce9f6181045e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 07:51:35 +00:00
David Schulz
bdc8411af5 Editor: add update optional actions function to action handler
Change-Id: I342fc53aaa845c6fa2933ea19a0a36a6dc8e6338
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 07:50:00 +00:00
David Schulz
3559af69db TextEditor: move rename symbol action to text editor
Task-number: QTCREATORBUG-21578
Change-Id: I9a873dcd38bacb2287c45973b6be0091c3eb9480
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-12 04:28:19 +00:00
Eike Ziller
d43f1662d0 Make TextEditor setup more flexible
So far it was only possible to combine TextEditorFactory, BaseTextEditor
and TextEditorWidget directly.
That TextEditorWidget is also directly a QPlainTextEdit made it
impossible to "decorate" the text editor widget with something else
without a lot of effort.

Make it possible to create a text editor factory that returns an
arbitrary widget, as long as it can be "cast" to a TextEditorWidget with
either qobject_cast or Aggregation::query. That way the TextEditorWidget
instance can be attached to the editor widget via Aggregation.

Adapt other code that accesses TextEditorWidget from editors
accordingly. Introduce a common method how to do that.

Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-02-12 10:28:31 +00:00
hjk
9c934ed44c TextEditor: De-QObject-ify TextEditorActionHandler
Change-Id: I8c4919b89ce35d421edd4a21a650d5e0df4a7ead
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-02-10 13:54:39 +00:00
hjk
515baaa5e7 TextEditor: Remove unused TextEditorActionHandlerPrivate::q
Change-Id: I2f8c86c21e2879e36a24d645ec3670e3bcec7319
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-02-05 14:21:25 +00:00
David Schulz
4070d6a289 Editor: add formatter support
Change-Id: I65590273b2541e08a39970cd9bb4739a5634b2f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-22 06:00:11 +00:00
David Schulz
372014b843 Editor: Rename format -> autoIndent
Renaming the auto indent function triggered by Ctrl+I to make room
for a real format action.

Change-Id: If5731353311030d66a20f1093a7fdd300703ebbc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-09 07:41:05 +00:00
David Schulz
95cba448a1 move find usages to TextEditor
In preperation for supporting find usages by the language client plugin

Task-number: QTCREATORBUG-21577
Change-Id: I7a6da3a9d53478c1d486e0ddc5829c9ea09a2a20
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-28 12:29:44 +00:00
Orgad Shaneh
41dee83bec TextEditor: Modernize
override, auto, nullptr, member initializers.

Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 08:48:49 +00:00
Eike Ziller
7c3cfa166d Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/helpmanager.cpp

Change-Id: I2feb60ec0afb2f22f75dc137a01c3fa217b299d8
2018-02-23 10:56:52 +01:00
Eike Ziller
c7bb8305d7 Add overlooked Goto Document Start/End shortcut settings
Change-Id: I2f60e2607660cea98aebb1057226010ea4837156
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-02-13 13:29:27 +00:00
David Schulz
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +00:00
Tobias Hunger
69a2feea4f TextEditor: Fix warning about unused capture in lambda
Change-Id: I0c9558904ffb43ad6d106b20ce7dd3caea0f23d9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-19 09:57:47 +00:00
Serhii Moroz
bb58ab34c1 TextEditor: Add sortSelectedLines action
Change-Id: Ifdc82766bac3cfe2e9c287b4ef04902a943c8f72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-09-11 17:43:02 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Eike Ziller
fd7edcb826 TextEditorActionHandler: Use configuration instead of inheritance
Avoids creating subclasses just for implementing a single method.

Change-Id: I813a0a20eaba8fefa004b74f92d48a9a9c4bfcc1
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-18 08:24:20 +00:00
Eike Ziller
2684254fad Fix text based Android manifest editor actions
All text editor actions were disabled. We want the actions to be enabled
when the focus is in the text editor widget in the Android manifest
editor.

For this the text editor action handler must differentiate between the
_editor_ and the _context_ that it handles. The one for the text based
manifest editor handles the manifest editor, but the context is specific
to the text editor part.

Change-Id: Ib91cc763cb27333a7d5b6e5b036dfead33961871
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-18 07:08:56 +00:00
Eike Ziller
c9cd6b1223 TextEditor: Disable "duplicate selection" actions for read-only editors
Change-Id: Iea2cf0c05e1561fce3b6195e0f28a6086c30e217
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-18 06:26:33 +00:00
Eike Ziller
27a9fd7e7a TextEditor: Sort list of modifying actions
Change-Id: I7b5c8e03b7da18ea136210384f84355599618f40
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-18 06:26:19 +00:00
David Schulz
0ecc044478 TextEditor: Add delete(Start/End)OfLine actions
Task-number: QTCREATORBUG-18095
Change-Id: I75e6141687ba5e96ef59384b302357700f79dd55
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-26 09:48:43 +00:00
Tim Jenssen
1b62ce2a98 use direct member initialization
Change-Id: I74cae303ba3b7df771b16dd203e8b5fbc9adb398
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-25 10:44:51 +00:00
Michal Steller
768eb4e52e TextEditor: Duplicate selection (Duplicate selection and comment)
New TextEditor action for duplicating current selection.
Extended version of this feature creates commented duplications.

Possible use cases:
1. No selection, cursor anywhere in text - Duplicity line
2. Simple selection - Duplicity selection
3. Block selection, without columns - Duplicity lines
4. Block selection, with columns - Duplicity selection

Cursor position and selection stays unchanged. Works well with Undo
action.

First use case with no selection looks similar as copyLineDown, but
difference is that copyLineDown moves current cursor position and select
created line. This feature don't change cursor position. Because of this
difference it is not possible to integrate this additions with
copyLineDown.

Quick intro: https://youtu.be/Fv6WdCnCLpo

Change-Id: I7c36fca6e17de030cbd22cfa103c2ed672deabbc
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-21 10:00:10 +00:00
David Schulz
db0c289f02 Editor: Add action to select word under cursor
Task-number: QTCREATORBUG-641
Change-Id: I83e2705c7250646b13cd3ec52779a1496e6a472c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-02 07:29:15 +00:00
Takumi ASAKI
15543d5957 TextEditor: Add missing message
Change-Id: I208e53aac3f897789fafdce0d71bcb40e0e8664c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-29 12:32:16 +00:00
Alexandru Croitor
bed88818ce C++: Implement context-aware expand / shrink selection actions.
Implement selection expanding / shrinking, that is aware of C++
semantics, thus giving smart selection changing.

Change-Id: I1386a20597fa6bb85c3aa0d8ddfb87cdb3fd7c38
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-29 08:15:03 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
David Schulz
ae3b9042c9 Editor: Use internal zoom functions.
Task-number: QTCREATORBUG-15609
Task-number: QTCREATORBUG-15608
Change-Id: I133ddbbb55cd5b876daed9e33c7a93b07e2d2e38
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-14 07:58:11 +00:00
Leena Miettinen
d36e13b45b Text editor: fix UI text capitalization
Change-Id: I0d8d481b043973b56c6c051b8c0224349451ff26
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-10-23 08:06:47 +00:00
hjk
9c8eeaccd0 TextEditor: Pass menuGroup as Core::Id around, not as char *.
Will be used as that in the end, we can be clear about
its true nature.

Change-Id: I8928678eba12ecdbd32c291f3c02c5c89700ff76
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-07-01 09:12:06 +00:00
Sergey Belyashov
7fa58f1d99 Fix missing of some translations
Task-number: QTCREATORBUG-13649
Change-Id: I69f78b3b8d2366003bfce81a2afba0068e716d22
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-03-24 07:04:46 +00:00
Friedemann Kleint
54da18eaaa Clean exported headers of the Core plugin.
Change-Id: I26472d568844d5fee62323e01f5c5c12082d5450
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 07:18:14 +00:00
Friedemann Kleint
fe2addf515 Clean exported headers of the TextEditor plugin.
Change-Id: I1e7dd34ba5a51fb0b34d137dc03add4457b32ed1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-26 13:15:29 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
ea27143239 Merge remote-tracking branch 'origin/3.2'
Conflicts:
	src/libs/utils/ipaddresslineedit.cpp
	src/libs/utils/logging.h
	src/plugins/analyzerbase/AnalyzerBase.pluginspec.in
	src/plugins/android/Android.pluginspec.in
	src/plugins/android/androiddeploystep.cpp
	src/plugins/android/androiddeploystep.h
	src/plugins/android/androiddeploystepfactory.cpp
	src/plugins/android/androiddeploystepwidget.cpp
	src/plugins/android/androidpackagecreationfactory.cpp
	src/plugins/android/androidpackagecreationstep.cpp
	src/plugins/android/androidpackagecreationstep.h
	src/plugins/android/androidpackagecreationwidget.cpp
	src/plugins/android/androidpackagecreationwidget.h
	src/plugins/android/javafilewizard.cpp
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/baremetal/BareMetal.pluginspec.in
	src/plugins/bazaar/Bazaar.pluginspec.in
	src/plugins/beautifier/Beautifier.pluginspec.in
	src/plugins/bineditor/BinEditor.pluginspec.in
	src/plugins/bookmarks/Bookmarks.pluginspec.in
	src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in
	src/plugins/clangcodemodel/clanghighlightingsupport.cpp
	src/plugins/clangcodemodel/clangsymbolsearcher.cpp
	src/plugins/classview/ClassView.pluginspec.in
	src/plugins/clearcase/ClearCase.pluginspec.in
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in
	src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp
	src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
	src/plugins/coreplugin/Core.pluginspec.in
	src/plugins/cpaster/CodePaster.pluginspec.in
	src/plugins/cppeditor/CppEditor.pluginspec.in
	src/plugins/cppeditor/cppfilewizard.cpp
	src/plugins/cpptools/CppTools.pluginspec.in
	src/plugins/cpptools/cpphighlightingsupportinternal.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.h
	src/plugins/cvs/CVS.pluginspec.in
	src/plugins/debugger/Debugger.pluginspec.in
	src/plugins/designer/Designer.pluginspec.in
	src/plugins/diffeditor/DiffEditor.pluginspec.in
	src/plugins/emacskeys/EmacsKeys.pluginspec.in
	src/plugins/fakevim/FakeVim.pluginspec.in
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in
	src/plugins/git/Git.pluginspec.in
	src/plugins/git/gitorious/gitorious.cpp
	src/plugins/git/gitorious/gitorious.h
	src/plugins/git/gitorious/gitoriousclonewizard.cpp
	src/plugins/git/gitorious/gitorioushostwidget.cpp
	src/plugins/git/gitorious/gitorioushostwidget.h
	src/plugins/git/gitorious/gitorioushostwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.h
	src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwizardpage.h
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.h
	src/plugins/glsleditor/GLSLEditor.pluginspec.in
	src/plugins/glsleditor/glsleditorfactory.cpp
	src/plugins/glsleditor/glslfilewizard.cpp
	src/plugins/helloworld/HelloWorld.pluginspec.in
	src/plugins/help/Help.pluginspec.in
	src/plugins/imageviewer/ImageViewer.pluginspec.in
	src/plugins/ios/Ios.pluginspec.in
	src/plugins/macros/Macros.pluginspec.in
	src/plugins/mercurial/Mercurial.pluginspec.in
	src/plugins/perforce/Perforce.pluginspec.in
	src/plugins/projectexplorer/ProjectExplorer.pluginspec.in
	src/plugins/pythoneditor/PythonEditor.pluginspec.in
	src/plugins/pythoneditor/pythoneditorwidget.cpp
	src/plugins/pythoneditor/wizard/pythonfilewizard.cpp
	src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in
	src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
	src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in
	src/plugins/qmakeprojectmanager/profileeditorfactory.cpp
	src/plugins/qmldesigner/QmlDesigner.pluginspec.in
	src/plugins/qmljseditor/QmlJSEditor.pluginspec.in
	src/plugins/qmljseditor/qmljseditorfactory.cpp
	src/plugins/qmljstools/QmlJSTools.pluginspec.in
	src/plugins/qmlprofiler/QmlProfiler.pluginspec.in
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in
	src/plugins/qnx/Qnx.pluginspec.in
	src/plugins/qtsupport/QtSupport.pluginspec.in
	src/plugins/remotelinux/RemoteLinux.pluginspec.in
	src/plugins/resourceeditor/ResourceEditor.pluginspec.in
	src/plugins/resourceeditor/resourcewizard.h
	src/plugins/subversion/Subversion.pluginspec.in
	src/plugins/tasklist/TaskList.pluginspec.in
	src/plugins/texteditor/TextEditor.pluginspec.in
	src/plugins/texteditor/basetexteditor_p.h
	src/plugins/texteditor/basetextmark.cpp
	src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h
	src/plugins/texteditor/codeassist/defaultassistinterface.h
	src/plugins/texteditor/codeassist/iassistproposalitem.cpp
	src/plugins/texteditor/itexteditor.cpp
	src/plugins/texteditor/itexteditor.h
	src/plugins/texteditor/itextmark.cpp
	src/plugins/texteditor/plaintexteditor.cpp
	src/plugins/texteditor/plaintexteditor.h
	src/plugins/texteditor/texteditoractionhandler.cpp
	src/plugins/todo/Todo.pluginspec.in
	src/plugins/updateinfo/UpdateInfo.pluginspec.in
	src/plugins/valgrind/Valgrind.pluginspec.in
	src/plugins/vcsbase/VcsBase.pluginspec.in
	src/plugins/welcome/Welcome.pluginspec.in
	src/plugins/winrt/WinRt.pluginspec.in
	tests/auto/debugger/temporarydir.h

Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
2014-10-14 15:36:16 +02:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
hjk
10c8d5f0ca TextEditor: Rename BaseTextEditorWidget to TextEditorWidget
... and some of the related implementation details

Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-09-29 14:54:32 +02:00
marcel
7852d61dda Re-add Label for action JumpToFileUnderCursorInNextSplit.
The label got lost in f1eb9c4827

Change-Id: Idedbc471a2ea6104e900d626ff7b424d51092624
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-09-29 14:50:26 +02:00
hjk
953cdb971f TextEditor: More BaseText* -> Text* renamings
*Document* and *Layout* classes, all basetext* files

Change-Id: I1c6e376733a434fcb5c7f19c6210dfa031eeafde
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-09-26 10:12:51 +02:00
Christian Kandeler
1d5091e48f Do not use deprecated Qt functionality.
Replace all* remaining deprecated Qt 4 functions with
their Qt 5 counterparts. This means we no longer need to
define the QT_DISABLE_DEPRECATED_BEFORE macro.
This patch is relatively small because most source-compatible
changes of this kind have been done before.

* The one exception is the QmlDesigner, which uses QWeakPointer
in a deprecated way all over the place.

Change-Id: Id4b839c6685f3b5bdf2b89137f95231758ec53c7
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-08-29 14:10:41 +02:00
hjk
0e81b718d9 TextEditor: Compile fix with MSVC 2012
Change-Id: Ifd7652e109adf4b57f5cb3aef9b5aab59a34f0a4
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-08-27 18:35:05 +02:00
hjk
8d74fdd6d4 TextEditor: C++-ify texteditoractionhandler
Macros are not necessary here.

Change-Id: I19e5c38e64f1b7f254c1fcb33d891e02704e3657
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-27 17:06:24 +02:00