Commit Graph

405 Commits

Author SHA1 Message Date
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
David Schulz
f66df921d7 Core: filepathify file renaming
Change-Id: I3d4f39e34e65cde3df7b7c19570e3a54d0625d53
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-17 11:13:51 +00:00
hjk
d0c32df3fe FakeVim: Don't create two handlers for one editor
Amends 206e9f95fb.

Fixes: QTCREATORBUG-25770
Change-Id: I4028a7c8257ee3985fd2198e789d98b25901d92d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-11 08:20:23 +00:00
hjk
19d078bb5c FakeVim: Use new IOptionsPage convenience functions
Change-Id: I739fe152a4f642a19c90be71bbe5adbc8747f402
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-01 07:44:22 +00:00
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
hjk
50f93710b7 FakeVim: Aspectify settings
Change-Id: Ic73edce82e192779ed3efe86a5cb747a52d94d36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-03 07:12:21 +00:00
Christian Kandeler
1027b94fcb Fix some compiler warnings about unused variables
Change-Id: I9a9450eab68f53b08722adb9a5d33c4f318b2129
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-25 15:55:39 +00:00
Tom Praschan
1085d6b508 FakeVim: Add emulation for vim-surround plugin
Change-Id: If450d04dd89a1707ab05806522fbf4cc987d454b
Reviewed-by: hjk <hjk@qt.io>
2021-02-17 08:50:21 +00:00
Tom Praschan
d7acee920d FakeVim: Add emulation for argtextobj.vim plugin
Change-Id: I319d2b9fe9f0d145c2560cf03fecc50629c99006
Reviewed-by: hjk <hjk@qt.io>
2021-02-12 08:36:29 +00:00
Tom Praschan
f83eeb0548 FakeVim: Add emulation of vim-exchange plugin
Change-Id: I844c9bf11231ab842cee020a0e7a29af8ed209eb
Reviewed-by: hjk <hjk@qt.io>
2021-02-10 16:11:50 +00:00
Tom Praschan
b6f26ed67a FakeVim: Add emulation for ReplaceWithRegister plugin
Change-Id: Iaaeef6ff51fe858b759c10adaac582f5858b6210
Reviewed-by: hjk <hjk@qt.io>
2021-02-09 07:33:03 +00:00
Tom Praschan
f626e27370 FakeVim: Add emulation for vim-commentary
Change-Id: I34f222182835ae160e6c4c66ad0bada79d8abeff
Reviewed-by: hjk <hjk@qt.io>
2021-02-03 17:58:22 +00:00
hjk
206e9f95fb Core: Signal duplicated editors
FakeVim needs some notification even in cases where the
duplication is triggered outside the EditorManager as in
QmlDesigner's qml-editor.

Fixes: QTCREATORBUG-22344
Change-Id: Ia4950ff4b02d3f89779f03ff4c106a07ccff2106
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-14 08:31:44 +00:00
hjk
289a18f56f FakeVim: Change shortcuts from Alt-V,X to Alt-Y,X
Alt-V is taken by the Views menu nowadays.

Also, fix the instruction to quit FakeVim on Mac.

Fixes: QTCREATORBUG-24694
Change-Id: I5268760f45e34f973b3b38b19d2577c0c655b000
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-10 12:29:14 +00:00
David Schulz
f220cb0e23 Revert "Editor: Make line spacing adjustable"
This does not work with text wrapping since there are multiple
QTextLines inside a block but we can not adjust the line hight inside a
block. This needs to be addressed inside Qt.

This reverts commit dc64f3207b.

Change-Id: If6c28056da9891eeeb75f5939a42f08360013a80
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-20 04:35:42 +00:00
hjk
fcaa6801cf Utils: Start replacing SavedActions by QAction or Utils::Aspect
First mechanical step here is to derive SavedActions from BaseAspect
instead of QAction.

Change-Id: I2ec95883b825462c1d867f83cc2b3bd2c2732055
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-05 08:46:27 +00:00
David Schulz
dc64f3207b Editor: Make line spacing adjustable
Fixes: QTCREATORBUG-13727
Change-Id: I3dbc3277795b339bced81dc6c5a048c828183cb6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-01 12:11:09 +00:00
Eike Ziller
f811b87c66 EditorManager: Small API clean-up
- Move private enum to private header
- Add missing parameter to openEditorAtSearchResult
- Remove convenience singular close* methods, we have {} nowadays

Change-Id: Ic5b6d831a9f506ffee09b89b3358874433d62998
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-30 14:57:20 +00:00
hjk
89296a98a0 Qt6: Adapt to removed QMap functionality
QMap::iterator::operator+() was removed in 14090760a8, necessitating
extra code using std::next/prev to workaround.

QMap::unite is gone, the replacement QMap::insert was only introduced
in 5.15.

QMap key values need to have an operator==() available.

Task-number: QTCREATORBUG-24098
Change-Id: Ic4cf429ab18cad58b1218180de40eb65586afd77
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-08-13 12:11:36 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
hjk
dc68792c3a FakeVim: Start porting QRegExp uses to QRegularExpression
QRegExp will not exist in Qt 6.

Task-number: QTCREATORBUG-24098
Change-Id: Iaf239fd110b2294ad1fe20a598d416a4f43a3abf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-11 11:34:09 +00:00
hjk
cdfc62b287 FakeVim: Modernize a bit
Some ranged-for and const.

Change-Id: I6ff521393166aa4c61289de88e8c31320887b1b4
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-28 07:28:37 +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
d43b793dd8 Core: Introduce a IOptionsPage::setCategoryIconPath
Less noise on the user side.

Change-Id: I34dea09e8a3c8639f5a7db89b22f8b825b946395
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-16 09:53:45 +00:00
Andrzej Ostruszka
76eba270bf fakevim: fix indenting of continuation lines
Use tab settings for indenting of continuation lines from current
document instead of using default value.

Task-number: QTCREATORBUG-20876
Change-Id: Ied15226166483dc11672c930145564cf897def19
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-07 07:24:18 +00:00
hjk
78a5b42942 FakeVim: Fix goto next/previous split
Fixes: QTCREATORBUG-22397
Change-Id: Ibdae1d53d9d77dd982b871aa22585bdf0354d84f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-16 11:32:58 +00:00
Sona Kurazyan
82bcf4e9f5 Remove usages of deprecated APIs
Replaced:
  QPalette::ColorRole::Background -> QPalette::ColorRole::Window
  QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText
  Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole
  QFontMetrics::width() -> QFontMetrics::horizontalAdvance()

Task-number: QTBUG-76491
Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-03 09:15:30 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Alessandro Portale
0933c20de8 connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 14:07:03 +00:00
Ivan Donchevskii
d7058e1afe ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.

First simple unit-test proofs it builds and runs.

Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-22 09:52:15 +00:00
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00
hjk
d9531340ae FakeVim: Disable cursor blinking by default
Add an option to enable

Task-number: QTCREATORBUG-21613
Change-Id: Ia0553f0b89b22c1d5b47487cd6e5b3c3a523cd6d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-04 08:08:10 +00:00
Alessandro Portale
df1f975252 FakeVim: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default

Change-Id: I320a08a99a1d18ab87aec207ec1e03190009b592
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-08 21:32:29 +00:00
hjk
96be20d816 FakeVim: Alias C-w C-h/j/k/l to C-w h/j/k/l
In Vim land do as Vim does.

Change-Id: I4172039804fbee2c596f02587028943ac9845164
Task-number: QTCREATORBUG-20923
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-15 06:26:10 +00:00
hjk
b3f4282edc FakeVim: Add support for :wqa
Task-number: QTCREATORBUG-20699
Change-Id: I01e5e69abe9a7192f19d604847443f550a20ef0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Lukas Holecek <hluk@email.cz>
2018-07-02 14:01:42 +00:00
Alessandro Portale
4317e350f5 Update Options dialog icons
A new set of scalable and themable icons with unified look as provided
by Diana.

Task-number: QTCREATORBUG-20325
Change-Id: I68498b034e9e43fbb61511a38d9c7fc0003ab076
Reviewed-by: hjk <hjk@qt.io>
2018-04-24 14:43:35 +00:00
Eike Ziller
d1ec4c1204 Clean up options page category display name and icon set up
In cases where plugins extend an existing settings category of a plugin
that they depend on anyhow, they do not need to specify the translated
display name and icon for that category.
Some options pages were already not setting the icon, but still the
translated name, which makes even less sense.
Clean up this mess, only setting display name and icon if that is
necessary.

Change-Id: I8bc9d0c51b11d48f1d847337838704d663e70b45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-23 11:12:26 +00:00
Tobias Hunger
0a690479d3 FakeVim: Quieten warnings
Quieten warnings about inconsistent use of override and unused
lambda captures.

Change-Id: I576937dfb86343c3e99d18348966093d5a2c3471
Reviewed-by: hjk <hjk@qt.io>
2018-03-06 14:18:09 +00:00
hjk
3ea4b0156c FakeVim: Experiment with hand-written signals
Change-Id: If76c68d3abb42240a279c15cf4b3d4b9e04460bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-03-02 09:07:33 +00:00
David Schulz
a4b5fc00a8 CodeAssist: use shared pointer to pass around proposal models
Task-number: QTCREATORBUG-17752
Change-Id: Ia41f169b86ead209830e6f15764062389ced2b67
Reviewed-by: hjk <hjk@qt.io>
2018-02-27 12:32:36 +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
3060ddbcf3 Document model: Use optional for "indexOf" kind of methods
Change-Id: Iaffbb0b695f96b5b44c9fd0df63891c2797181b7
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-16 08:32:05 +00:00
hjk
25b5433ae9 FakeVim: Squash MSVC warning about supposedly non-captured 'this'
Change-Id: Ibb81d15209d0c71a67f4707aa981b21fae1e3950
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-15 07:21:37 +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
hjk
5250959bd9 FakeVim: Reorganize internal class dependencies
Initially, this was just meant to remove the nowadays unneeded
object pool registrations, but some of the internal encapsalization
is not much more than line noise. So do what most other plugins do:
Keep a global pointer to most of the 'singleton' data, instead of
passing around one value that will never be different.

Change-Id: I24bf02d1ffa53c8f0d4890db3579a434b1233d42
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: hjk <hjk@qt.io>
2018-01-26 17:27:15 +00:00
hjk
3c91777e48 Core: Detach status bar handling from global object pool
Instead of relying on addObject notification, provide a
StatusBarManager::addStatusBarWidget() method to create,
register and keep track of an IContext object.

That's essentially what was StatusBarWidget before, but does
not need to be known on the user side. For removal, this
provides a StatusBarManager::destroyStatusBarWidget(),
any not explicitly removed items are handled in response
to ICore::coreAboutToClose()

The StatusBarManager class is fully static now, could
be a namespace.

Change-Id: Ia2bd13b391c3f68c8dfd584b53524a9649cc0787
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-26 10:20:38 +00:00
Eike Ziller
437590a999 Merge remote-tracking branch 'origin/4.6'
Change-Id: I49e8b8442e2b5edffbea19cb2bba97443ebc3d2a
2018-01-23 17:06:59 +01:00
Christian Stenger
8dae0c4613 FakeVim: Correct handling of settings
Fix handling of restoring default values. If the user
restores default values ensure that these changes are
taken into account as well, otherwise the user would
restore the old settings (instead of default settings)
when restarting QC.

When changing command mappings for FakeVim write the
changes immediately to the settings if the user leaves
the options without canceling.

Change-Id: I81ee47af6a208823d4afecb71cbaddcf2d571750
Reviewed-by: hjk <hjk@qt.io>
2018-01-23 06:12:58 +00:00
hjk
8320ae06f7 FakeVim: Use a more standard pattern to add option pages
Change-Id: I4167f98b29226ed9ae8eb630ea9d544db149da2c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-18 13:21:03 +00:00
Tobias Hunger
c330cf0679 Replace manual signal blocking/unblocking with QSignalBlocker
Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-04 09:35:06 +00:00