aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/fakevim
Commit message (Collapse)AuthorAgeFilesLines
...
* FakeVim: Remove QtcProcess use from fakevimhandler.cpphjk2023-05-023-27/+16
| | | | | | | | | fakevimhandler.{h,cpp} are meant to be re-usable outside of Qt Creator. Amends 91605c3. Change-Id: I569a393d13049ef92ed3ef0c4f69de5232b2fa32 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* FakeVim: Accept suggestion with Tab KeyMarcus Tillmanns2023-05-023-81/+96
| | | | | | | | | | * Changed signals to callbacks as only one receiver was ever added * Added "tabPressedInInsertMode" callback to allow accepting a suggestion with the Tab Key Fixes: QTCREATORBUG-28830 Change-Id: Ie70ba595b8802b6100fff495164d8e0471b1354c Reviewed-by: hjk <hjk@qt.io>
* FakeVim: Block SuggestionsMarcus Tillmanns2023-05-023-25/+60
| | | | | | | | Block suggestions when FakeVim is enabled and the mode is not "Insert" or "Replace". Change-Id: I778eb25d9570b76e42652f9d938a8c580033c462 Reviewed-by: David Schulz <david.schulz@qt.io>
* FakeVim: Clear suggestions on mode changeMarcus Tillmanns2023-04-273-0/+14
| | | | | | Change-Id: I5d3a37ab61f83a70e055063de397654f5621401d Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io>
* FakeVim: Avoid using invalid regular expressionsChristian Stenger2023-04-271-3/+18
| | | | | | | | | | | Print a warning in case of an invalid regular expression and do not apply it to the settings. This silently drops invalid regular expressions entered and restored from settings. Change-Id: I2f7686066541cf2307cf7cf96b3c6f89f6a677d8 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* FakeVim: Re-organize ExCommand settings page setuphjk2023-04-251-111/+103
| | | | | Change-Id: I085a86529fc840472aabf7ae62d6565f454256ae Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* FakeVim: Use IOptionPage::setWidgetCreator() for user command settingshjk2023-04-251-61/+52
| | | | | Change-Id: Ic5d895634cb5ef1b2e1a6fa465cd800a213a7d41 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Qbs build system: Add a component for test files groupsAlessandro Portale2023-03-211-3/+1
| | | | | | | | | Mainly in order to enforce a unified group name across QtC libraries and plugins. Change-Id: I6eafe0f9d227ec73d8c9029675866c67063768fb Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Translations: Change translation context prefix from "::" to "QtC::"Alessandro Portale2023-02-101-1/+1
| | | | | | | lupdate would be confused by translation contexts starting with :: Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c Reviewed-by: hjk <hjk@qt.io>
* FakeVim: Tr::trAlessandro Portale2023-01-232-39/+38
| | | | | Change-Id: Idca64705f2058d22480da6a624008971c8d8aab4 Reviewed-by: hjk <hjk@qt.io>
* Use simpler Plugin::initialize() when feasiblehjk2023-01-202-9/+5
| | | | | Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Prefix Tr::tr contexts with ::hjk2023-01-131-1/+1
| | | | | | | To make outliers better visible in Linguist Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-068-8/+8
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Editor: move ownership of assist interface to processorDavid Schulz2022-11-171-5/+4
| | | | | | | | | | This way the base class can manage the lifetime of the interface object and it doesn't need to be done in each implementation of perform. Change-Id: Ie1ce742e31b688a337533ee6c57d376146e25ace Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Editor: unify assist processor handlingDavid Schulz2022-11-141-13/+14
| | | | | | | | | | | Define the run type of the processor by its implementation instead of a enum value of the provider. The execution of a processor inside the assist now follows a unified procedure. Change-Id: Ibe9fab324c6072e77702c2663946d7a9f562a085 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace missing qAsConst with std::as_const()Jarek Kobus2022-10-101-2/+2
| | | | | | | | | Patch missing leftovers after recent batch patch. Amends 8eb4d52342fe3a6ede1c1dce3174d95bfa0cea88 Change-Id: I5469b8c10e6844cd1911f719ce3dddbb42697f95 Reviewed-by: hjk <hjk@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-072-4/+4
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Fix logical XORJarek Kobus2022-10-071-1/+1
| | | | | | | | | | | | | The '^' is the bitwise XOR, we should use logical XOR in these contexts. The operator!=() should serve for it. More info and reasoning: https://stackoverflow.com/questions/24542 Change-Id: I1bd70bdcab25455f409594f0f14c209d1de11d18 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* FakeVim: Replace foreach with ranged for loopJarek Kobus2022-10-052-15/+16
| | | | | Change-Id: I0de9620ebf837be25e153bfd282b6564d4d2b115 Reviewed-by: hjk <hjk@qt.io>
* Re-introduction of the feature to adjust the line spacingFlorian Koch2022-09-121-1/+1
| | | | | | | | | | | | | | | | This already has been implemented in change dc64f3207bdf6c0d295859e47791cb8193e67f4e, but was reverted with change f220cb0e23729ddccf52c25dae4e4696641bc62d) because this does not work with text wrapping rendering, due to internal limitations of Qt. Since this is a highly requested feature (e.g. QTCREATORBUG-13727), but an internal change within Qt is not in sight, the approach taken here is to offer the text wrapping feature in the settings only when the line spacing is set to 100%. Additionally, a change has been made to the layout of the display settings page to reflect this. Fixes: QTCREATORBUG-13727 Change-Id: Ib233cf90a5f336bc591fa1bf860e162fa774dfe3 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Remove Utils::optionalEike Ziller2022-09-012-3/+3
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-268-192/+16
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Settle on lowerSnakeCase for LayoutBuilder::Setterhjk2022-07-271-2/+2
| | | | | | | Change-Id: Icfe487d8c7712cc8ad28f0f61e8ae4778a356fc3 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Make the second parameter to LayoutBuilder::attach() an enumhjk2022-07-261-1/+1
| | | | | | | | More explicit and more potential options (e.g. "treat grid as form") than a bool. Change-Id: I89413efe30410160c38b0e524ba64288dde2332e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Introduce Layouting::{br,st}hjk2022-07-251-3/+3
| | | | | | | | | | | | | ... as "standard" ways to define line breaks and simple stretch. There have already been too many patterns to do it. Break() and Stretch() still work for the patches in flight, but they are planned to be removed. Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: Make Layouting::Group { .. } less weirdhjk2022-07-221-8/+12
| | | | | | | | | It had a implicit vertical layout leading to unneded layout nesting in quite a few cases. The price is an added Column { ... } in those places where the implicit vertical layout was sufficient before. Change-Id: I3ae1f03f9c1d691bd0c563b0447edd03ee02bbd2 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* FakeVim: Partially implement multi repeat command (:g, :v)hjk2022-06-271-1/+58
| | | | | | | Change-Id: Ifed113e80103b9fdd109cb4a5a6a31098f77d74c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Lukas Holecek <hluk@email.cz> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* FakeVim: Fix crash with debug build of Qt 6hjk2022-06-201-2/+2
| | | | | | | | | | | 915be6606ead2 in Qt base introduced an assert that triggers occasionally. This here moves the original check to the fakevim side, without changing (possibly wrong) functionality. Change-Id: I435ea53ecc0ba1a905dee2f4e3f8feb3c6dc7db3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* FakeVim: Simplify calling external processeshjk2022-06-201-10/+1
| | | | | | Change-Id: I5157e2e73654df8bef65d72b7209c487e8b0c881 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: More forward declarations / drop unused headers [D-G]Jarek Kobus2022-05-251-0/+1
| | | | | | | | | | | Round 1 - focus on headers. For classes with initial in range [D-G]. Try to keep the same separators between different kind of headers. Change-Id: Id42cd7b3743a816f75cecb6b576c0e37cb057473 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* FakeVim: Fix compiler warningEike Ziller2022-05-191-1/+1
| | | | | | | | Remove unused lambda capture Change-Id: I973a5a6be6e2c27450ab80bbb87c9077f0ecd3e9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Remove outdated codeRobert Löhning2022-03-091-10/+0
| | | | | | | Change-Id: I65e0ed79dabd987bc67d4082969835d52dd7cb8b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* FakeVim: Support backslashes in substitute command patternshjk2022-02-032-1/+54
| | | | | | | Change-Id: Ibfcea7fdc550082e4975e1fc4d2fba6563dbfd02 Done-by: Jochen Baier Fixes: QTCREATORBUG-26955 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove qmake build filesEike Ziller2022-01-202-30/+0
| | | | | | | | | | Removes qmake as a build system for building Qt Creator itself. Keep them for some tests that are not completely moved to CMake yet. Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* FakeVim: Improve handling of content changesChristian Stenger2021-12-071-8/+32
| | | | | | | | | ..when indenter or auto completer may interfere. Task-number: QTCREATORBUG-26195 Change-Id: Iaf0eefd74344423409fa0c22f8e3ea618b4c9930 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* FakeVim: Fix GUI text for "Smart indentation" settinghjk2021-11-241-1/+1
| | | | | | Change-Id: Ib347a36dd10a6474aae4da7285f4374593d372f6 Fixes: QTCREATORBUG-26607 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* EditorManager: Remove QString openEditor(At) overloadsEike Ziller2021-11-021-6/+7
| | | | | | | | In favor of the FilePath/Link ones. Change-Id: I5caf9e0f8de304ff4ee12329557aa50a6f3a0c69 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* Use QtcProcess inside fake vim handlerJarek Kobus2021-10-291-12/+5
| | | | | Change-Id: I14af193bbf9e7fda9e5b0ba0a1647e19069c40e2 Reviewed-by: hjk <hjk@qt.io>
* Fix qHash-related size compatibility warnings by MSVCOrgad Shaneh2021-10-201-1/+1
| | | | | | Change-Id: I3b7981ce78b67db4b996f99682284a0b911d8cd7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* FakeVim: Use setEnabler for the vimrc path aspecthjk2021-10-151-11/+2
| | | | | | | | | This fixes the enabling/disabling of the line edit and triggers the (re-)read of the .vimrc at the right times. Change-Id: I13a022aafc23ea761d3c1c4d0359cc5f137695d5 Reviewed-by: Lukas Holecek <hluk@email.cz> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* FakeVim: Only drop full-line commentshjk2021-10-131-5/+4
| | | | | | | | | | | This is not what real vim does, but :help comments looks scary, we don't support more complex scripts anyway, and full-line comments at least allow some commenting. Fixes: QTCREATORBUG-26254 Change-Id: I9018d06d2a929fad6d3d301240928b6a8b109710 Reviewed-by: Lukas Holecek <hluk@email.cz> Reviewed-by: hjk <hjk@qt.io>
* Revert "FakeVim: Also record NoVisualMode as last visual mode"hjk2021-10-111-2/+2
| | | | | | | | | This reverts commit e5dd24322fedb28592f5a741b42877da8253465c which caused QTCREATORBUG-26214. Fixes: QTCREATORBUG-26214 Change-Id: I0d285b4df8fa428201fb6c48bbbad81f8195a941 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Editor: multi cursor supportDavid Schulz2021-09-271-6/+28
| | | | | | | | | | | | | Adding a way to create multiple cursors that can insert/remove text at arbitrary positions in the document. Adding cursors is done by pressing alt + up/down or by clicking into the editor while holding the alt key. Fixes: QTCREATORBUG-16013 Change-Id: I495d27d95a3d277220946616ef30efc241da0120 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Editor: pass AssistInterface to createProcessorDavid Schulz2021-09-161-2/+2
| | | | | | | | | The interface can be used for checking the context of a codeassist request to determine the correct processor that has to be created. Change-Id: I47ddb05c46399566e27bae21711f11a3a4132c3f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-014-8/+6
| | | | | | | | | | | | | | | | 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>
* FakeVim: Update visual marks when mark settings have changedhjk2021-07-211-0/+5
| | | | | | | To test: ":set sm", "ma", "<Down>", ":set nosm" Change-Id: I75d2c3ded04ddf3bc656574a3cff136db144df2b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* FakeVim: Also record NoVisualMode as last visual modehjk2021-06-181-2/+2
| | | | | | Fixes: QTCREATORBUG-25822 Change-Id: I9a63726d357e3ea3d92b05a5d77cad5221c03f93 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core: filepathify file renamingDavid Schulz2021-06-171-11/+11
| | | | | | Change-Id: I3d4f39e34e65cde3df7b7c19570e3a54d0625d53 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* FakeVim: Don't create two handlers for one editorhjk2021-06-111-0/+8
| | | | | | | | Amends 206e9f95fb1. Fixes: QTCREATORBUG-25770 Change-Id: I4028a7c8257ee3985fd2198e789d98b25901d92d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* FakeVim: Use new IOptionsPage convenience functionshjk2021-04-011-96/+74
| | | | | Change-Id: I739fe152a4f642a19c90be71bbe5adbc8747f402 Reviewed-by: Christian Stenger <christian.stenger@qt.io>