summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor
Commit message (Collapse)AuthorAgeFilesLines
* Utils: fix Text::Range length and remove midDavid Schulz2023-05-121-3/+7
| | | | | | | | | | | | | | | | Those functions are based on the assumption that the passed text starts at the begin position, which was good enough for search results, but if used in other parts of the codebase it might give unwanted results. Calculate the length of the range now as expected and subtract the beginning lines. In order to still got the correct results for the text result texts modify the result range to always start at the first line before calculating the length of the range. Also add tests for the modified functionality Change-Id: I7ccd75b642dda6dd4f738877cbe3543d46c03652 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-05-112-0/+14
|\ | | | | | | Change-Id: I98e5e1ad43103984b490c65cdeed84b7414303b3
| * ClangFormat: Fix code style preferences are grayed outArtem Sokolovskii2023-05-112-0/+14
| | | | | | | | | | | | | | | | | | Code style preferences are grayed out even when formatting mode is set to disable. Fixes: QTCREATORBUG-29129 Change-Id: Icf82fa0751f9291122c2af55111b6bd5fac85c7b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CodeAssistant: block suggestions while proposal is visibleDavid Schulz2023-05-111-0/+3
| | | | | | | | | | Change-Id: I78068306252c5c32304ea97e3abb2d87fdee7832 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Utils: Centralize style-related property names as constantsAlessandro Portale2023-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | This introduces string constants in Utils::StyleHelper. They are used by code all over in Qt Creator to tell ManhattanStyle how to paint certain widgets. Change-Id: Iecca36103f80084cd5fe93fcb6b18b8fbb3a32bb Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Markdown: Save and restore stateEike Ziller2023-05-101-61/+115
| | | | | | | | | | | | | | | | | | | | | | This restores the state of the markdown editor, including text editor state, preview scroll position and button states, when closing and re- opening a file. Change-Id: Ibf1cadd5e0e80149123c6c5f599157e931330343 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* | Markdown: Save visible views as defaultEike Ziller2023-05-101-4/+25
| | | | | | | | | | | | | | | | | | | | Remember if editor and/or preview are visible and use it as default for when a markdown editor is opened. Change-Id: I19414adfd118003628783fadeae472b7bb7915f5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* | LineNumberFilter: Remove the old matchesFor() implementationJarek Kobus2023-05-102-61/+5
| | | | | | | | | | | | Change-Id: Ia45de8cd265300776c9cb0660b491f9584620a14 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Remove ineffective resize() callsAlessandro Portale2023-05-108-13/+0
| | | | | | | | | | | | | | | | | | | | | | This removes apparently unnecessary resize() calls on QWidgets based forms which get anyways added to layouts and resized. Most of these size values looked "accidental", i.e. neither divisible by 2 nor by 5, in most cases a remnant from the ui inlining. Change-Id: I95da3b93f2915ef955b5235e5c2ecc94b51f813a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* | Utils: move TextPosition/Range to textutilsDavid Schulz2023-05-101-1/+1
| | | | | | | | | | Change-Id: Id94a7a96f3b0f978e94850d67eb4b8fba6c18fe2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Markdown: Support bookmarks and jumping to search resultsEike Ziller2023-05-091-9/+30
| | | | | | | | | | | | | | | | Redirect the currentLine/Column and gotoLine functions to the text editor and ensure that it is visible for gotoLine. Change-Id: I546e2cb1761363e3a75f9adeebcba195e312f00b Reviewed-by: David Schulz <david.schulz@qt.io>
* | FileSearch: Get rid of FileSearchResultJarek Kobus2023-05-093-74/+56
| | | | | | | | | | | | | | | | | | Use SearchResultItem instead. This change should reduce the remaining freeze described in a9eb732ce6763e22badd92fc8523cebe84b09a84 even more. Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Editor: Fix initial enabled state of margin settingsDavid Schulz2023-05-081-0/+2
| | | | | | | | | | Change-Id: I0adff884743dd8301a9c7f8b7a44f94658af4b5f Reviewed-by: hjk <hjk@qt.io>
* | Editor: simplify font to display options page connectionDavid Schulz2023-05-082-41/+13
| | | | | | | | | | | | | | Operating on saved settings is less error prone and easier to maintain. Change-Id: I92e3a6b52296cddc302ba2e4410edfd243b8ad32 Reviewed-by: hjk <hjk@qt.io>
* | Markdown: Delay update of previewEike Ziller2023-05-081-15/+38
| | | | | | | | | | | | | | | | | | | | | | | | Delay the update: The implementation in Qt is currently very slow, and while we don't have a fix, editing with immediate update is very sluggish. Also do not update the preview, if it isn't visible. Change-Id: I35e10af232064b02a36a8be3758ea0bbc5b66f40 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* | TextEditor: Remove now unused Q_OBJECT from BehaviorSettingsPagehjk2023-05-081-4/+0
| | | | | | | | | | Change-Id: I0919200ddc8bb8b4547316c0af68f5aafa5d4892 Reviewed-by: David Schulz <david.schulz@qt.io>
* | SearchResultItem: Introduce SearchResultItemsJarek Kobus2023-05-082-12/+7
| | | | | | | | | | | | | | | | And reuse it. Change-Id: Ia052297340f2bf2478fbfdb2427b45e30bd9d067 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Utils: Move SearchResultItem/Color into UtilsJarek Kobus2023-05-082-9/+13
| | | | | | | | | | | | | | | | | | It's going to be reused inside FileSearch. Change-Id: I8993d7158ff31c311c2283d32bc43465a8946a52 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Markdown: Fix focus handlingEike Ziller2023-05-051-12/+33
| | | | | | | | | | | | | | | | | | | | When the markdown editor is opened or switched to, the focus is set on the editor widget. We don't want the focus on the splitter, but on either the text editor or the preview, depending on what had focus before. Change-Id: Ib54899c6251f2c5362f95d990e7150b6fee0f1e1 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Toolbars: various toolbar layout tweaksAlessandro Portale2023-05-051-0/+3
| | | | | | | | | | | | | | | | | | This makes sure that toolbutton sizes and spacings are correct in all toolbar layout modes. Task-number: QTCREATORBUG-29082 Change-Id: If2aad74b77c0b8dcda81478e3d345c783584cec4 Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-05-051-4/+5
|\ \ | |/ | | | | Change-Id: I7a3925ad8e4f97461b64a70217102ed900430253
| * TextEditor: always return a valid assist interfaceDavid Schulz2023-05-021-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | It is required for updating currently visible proposals. Also guard against potential null assist interfaces. Amends 0bd6d7a69fab1cc622f6e00ee63a15c666967e0d Fixes: QTCREATORBUG-29096 Change-Id: Ic34d70561b471e7e529f2fb7c239b49712aca502 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}Jarek Kobus2023-05-041-1/+1
| | | | | | | | | | | | | | | | Follows QtcProcess -> Process rename. Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Utils: Rename QtcProcess -> ProcessJarek Kobus2023-05-041-2/+2
| | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-29102 Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c 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>
* | Layouting: Handle attach types via setterhjk2023-05-034-5/+8
| | | | | | | | | | | | Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}Jarek Kobus2023-05-032-2/+2
| | | | | | | | | | | | | | Follows AsyncTask -> Async rename. Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225 Reviewed-by: hjk <hjk@qt.io>
* | TextEditor: Use icons with better contrast in TextMark tooltipAlessandro Portale2023-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | The "_TOOLBAR" variants do not have a good contrast in some themes. This also introduces the missing non-toolbar variation for the EYE_OPEN icon. Fixes: QTCREATORBUG-29087 Change-Id: I64c8c6b7f5696d640c7bea7a431982caacd70050 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | TextEditor: Use IOptionPage::setWidgetCreator() for behavior settingshjk2023-05-032-88/+56
| | | | | | | | | | | | Change-Id: I24629e64b48c08b1321f0ebf3fca21e17a1f69a1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* | FakeVim: Block SuggestionsMarcus Tillmanns2023-05-022-0/+23
| | | | | | | | | | | | | | | | 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>
* | TextEditor: Add valid checks for text linesMarcus Tillmanns2023-04-271-4/+8
| | | | | | | | | | | | | | | | | | | | QTextLayout::lineForTextPosition can return invalid lines, which when accessed may crash. To workaround we add QTC_ASSERT to guard against this (see linked issue crash report) Fixes: QTCREATORBUG-28837 Change-Id: I66d8d8a46e766caa492ec2178b1fa88e35211333 Reviewed-by: David Schulz <david.schulz@qt.io>
* | ILocatorFilter: Simplify Sync's onSetup in matchersJarek Kobus2023-04-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove no longer necessary bool return value from onSetup functions and from refresh recipe functions, see df5e3c587a045fbd3d50233ecdde0e06dccf35a3. By default, when no return bool is specified inside a function passed to Sync element, it's assumed that the return value is true. Eliminate passing "=" captures in 2 lambdas. Change-Id: I5005821444a386f70c0f05322812f98d3fd49926 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | FutureSynchronizer: Change the default value of cancelOnWait to trueJarek Kobus2023-04-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "false" default wasn't really useful. This changes the default value to the following usages: 1. AndroidDeployQtStep Introduced in 91f136ef3ab75471cabcaed9dc16dad9f504add8 The synchronizer was used to cancel the running tasks inside the doCancel(), so the similar behavior should be expected when destructing the AndroidDeployQtStep. 2. GitClient Introduced in f3106ebafe9a02904e822e9698c8b4cbb6c7e0f5 Is used only inside the last line of GitSubmitEditor::updateFileModel(). The running function (CommitDataFetchResult::fetch) doesn't take QPromise<>, so it can't detect if the future was canceled or not. In this case this change is no-op. 3. ExtraCompiler Introduced in c99ce1f455189864de9a2043730f704d7b024abf The intention was to make it cancellable and finish early on cancel. 4. PluginManager global future synchronizer Introduced in 72bddf9f51fedd064f551bcb4ced5feeb46fdfc1 The intention was to make it cancellable and finish early on cancel. The relevant places in code are marked explicitly for points: 1, 2 and 3. Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | LineNumberFilter: Reimplement matchers()Jarek Kobus2023-04-252-0/+46
| | | | | | | | | | | | Change-Id: I5c4905aabaee81c7870994ca9019e451a7c23119 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Utils: Make Layouting a top level namespacehjk2023-04-256-6/+6
| | | | | | | | | | | | | | | | | | | | The whole machinery is now almost only layoutbuilder.{h,cpp}, mostly independent of the rest of Utils. Idea is to finish the separation to make it stand-alone usable also outside creator. Change-Id: I958aa667d17ae26b21209f22412309c5307a579c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | Markdown: Add option for hiding previewEike Ziller2023-04-251-20/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to hide the preview, by having a toggle button for "Show Preview" and "Show Editor", and ensure that at least one is always on and they are in the order as the views themselves. Disable the "Swap Views" button if only one is shown. Change-Id: I0ec1e06c2a8ec94e34bf52eae45ba009fd8cd1b5 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-244-3/+12
|\ \ | |/ | | | | Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
| * Merge remote-tracking branch 'origin/9.0' into 10.0Eike Ziller2023-04-242-3/+3
| |\ | | | | | | | | | Change-Id: Ifbb14e33104b39de8ca2e1495301a53e71496ef9
| | * Fix dangling references, found by GCC 13Thiago Macieira2023-04-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lifetime extension via const-ref only applies to functions that return by value. For those that already return by reference (such as QList::constLast()), no extension happens and we end up with a dangling reference. cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference] cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’ Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
| * | Editor: skip painting selection path out of clip rectDavid Schulz2023-04-181-0/+4
| | | | | | | | | | | | | | | Change-Id: Ieec7afbec729708884c24d8de2b4a6c488220a69 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * | Editor: fix selection path for empty selectionsDavid Schulz2023-04-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Especially targets the painting of empty snippet replacement placeholder like in the default "if" snippet. Change-Id: I42d9fb901c66cddf4eab9dd7275b42a8f4e81282 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * | ClangFormat: Fix preview updatingArtem Sokolovskii2023-04-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the behavior when the preview does not update when the Override checkbox was not enabled initially. Currently, the preview is updating when Override the checkbox is enabled. Fixes: QTCREATORBUG-29043 Change-Id: I8a2a6f3cd5890b66d4bffd0c84aeafb5a29fba48 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | TextEditor: Use IOptionPage::setWidgetCreator() for higlighter settingshjk2023-04-212-115/+66
| | | | | | | | | | | | | | | | | | Change-Id: I4e06e1606a66d00294899d26c0cb385d81ccea2d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* | | TextEditor: Use IOptionPage::setWidgetCreator() for snippets settingshjk2023-04-213-137/+83
| | | | | | | | | | | | | | | Change-Id: I9aa91edef20f325f1a2fc93388aecb5776b970d6 Reviewed-by: David Schulz <david.schulz@qt.io>
* | | Editor: add option to switch markdown viewer panesDavid Schulz2023-04-211-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-27883 Change-Id: I18daa688ff7751f984a95132737cfcc219b92108 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* | | Markdown: Fix that text editing actions were not availableEike Ziller2023-04-202-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | Add the TextEditorActionHandler and point it to the text editor. Change-Id: I2c84d6b0160c7402ea32d56ed4dbc72d512072a1 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | | C++ editor: Make generated Q_PROPERTYs FINAL by defaultUlf Hermann2023-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's bad style to omit the FINAL because such properties can be shadowed, causing problems in QML. Change-Id: I9083c69128f6335f584f0a1d28f1fe1e54a02eaf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | | Markdown: Reuse Markdown highlighter from change log viewerEike Ziller2023-04-191-1/+3
| | | | | | | | | | | | | | | | | | Change-Id: Ief1b0c135a34bfd5e9b5220e9fbf93f281d8e95a Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | LineNumberFilter: Use Acceptor for LocatorFilterEntryJarek Kobus2023-04-192-39/+12
| | | | | | | | | | | | | | | Change-Id: Id7da6d01a412633600c3ef905a5ddb18e9587bd7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-136-5/+23
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/python/pipsupport.cpp src/plugins/qtsupport/exampleslistmodel.cpp src/plugins/qtsupport/examplesparser.cpp tests/auto/examples/tst_examples.cpp Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
| * | TextEditor: remove redundant semicolonDavid Schulz2023-04-131-1/+1
| | | | | | | | | | | | | | | Change-Id: Iac82849a858bd567ff1230ec8c0ea48b5ef47e17 Reviewed-by: Christian Stenger <christian.stenger@qt.io>