aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/textdocumentlayout.h
Commit message (Collapse)AuthorAgeFilesLines
* TextEditor: Fix crash on reloading the documentDavid Schulz2023-08-041-1/+1
| | | | | | | | | | | | | | as part of the reload operation we set the document to nullptr inside TextBlockUserData::documentClosing, but we do not remove the mark from the marks cache. So when a text mark gets deleted while a document is reloaded the mark does not get readded to the document, but it wont get removed from the marks cache inside the document either, so we have to manually make sure the mark is removed from the cache in this situation. Fixes: QTCREATORBUG-29432 Change-Id: I3ae4182c4d2bbd3426c1d7a60275d21ac20ea99a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppEditor: Fix highlighting angle bracketsChristian Kandeler2023-05-301-1/+2
| | | | | | | | | The code assumed that all highlighting results come in at once, which is no longer true as of d6f5d07639c3d0313b758ba6fb7cc5eb57d188ef. Change-Id: I5ed6baf88956d64a30ee3fb236d4e2575a7f80c9 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* TextEditor: fix crash on reloadDavid Schulz2023-04-131-1/+4
| | | | | | | | | | | Since TextDocument::openImpl potentially processes events it could delete TextMarks. So tracking them in TextDocument::reload can be considered unsafe. Track them in TextDocumentLayout instead and remove the tracked mark if it gets deleted while reloading the document. Task-number: QTCREATORBUG-29004 Change-Id: I9d0478e9c763b49f145c1bbaeed1a0b602757014 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Copilot: Add insert next word actionMarcus Tillmanns2023-04-061-0/+3
| | | | | | Fixes: QTCREATORBUG-28959 Change-Id: Ied53ad5676133e2eb71988ecfcce90c5ad77e3c3 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: add a virtual destructor to TextSuggestionDavid Schulz2023-03-311-0/+1
| | | | | Change-Id: I30378a5a3367a79eb3b39bc921c409ca0af04119 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Copilot: add copilot suggestion tooltipsDavid Schulz2023-03-291-1/+0
| | | | | | | | | These tooltips allow to switch the currently visible suggestion as well as applying it using the mouse. Change-Id: I30b9a76ae57c66887f4e1b1311e1a7248ed0f194 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* TextEditor: introduce text suggestion interfaceDavid Schulz2023-03-291-13/+27
| | | | | | | | And also a copilot suggestion implementing that interface that allows reverting all changes done to a suggestion as well as applying it. Change-Id: I236c1fc5e5844d19ac606672af54e273e9c42e1c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* TextEditor: support inline suggestionsDavid Schulz2023-03-151-2/+10
| | | | | | | Change-Id: I70924a37f9078c5b33c1703e099fc9ddc0b1ae9a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Editor: Add replacement helper to document layoutDavid Schulz2023-02-021-1/+2
| | | | | | | | | More inline with the other text block user data members and cleaner on the client side. Additionally add some & for const arguments and remove test function call. Change-Id: I19e646aa204eedf447c02a2f76b89c3430280169 Reviewed-by: hjk <hjk@qt.io>
* TextEditor: add inline suggestionsDavid Schulz2023-02-011-0/+7
| | | | | Change-Id: I8c670a2aee17e461da1e3882d5b642da935b3d7a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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: paint location marker over everything elseDavid Schulz2022-09-071-0/+1
| | | | | | | | | | The location marker is updated very regularly and especially while stepping moves one line at a time. Resizing this marker when it enters a line that already contains a marker is visually distracting. To prevent this paint the marker over all other markers in that line. Change-Id: I63ad72384e77eeae4dc6d2e2c2ac77c88da92c56 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/8.0'hjk2022-08-051-0/+5
|\ | | | | | | Change-Id: Icbb87ac8bcee5fb86042d3863a973573510651b4
| * TextEditor: schedule update document layoutDavid Schulz2022-08-041-0/+5
| | | | | | | | | | | | | | | | When generating a lot of text marks we do not need to update the document for every mark and every property that changes. Change-Id: Ibba80138f6ebcbbe30a4f741979df69ad62608c1 Reviewed-by: hjk <hjk@qt.io>
* | TextEditor: remove mark width factorDavid Schulz2022-07-041-1/+0
|/ | | | | | | | Needed to optimize painting of different text mark icons in one line. Change-Id: Ia7f9dd12020e2a21875b3de54b65257f8ea337d9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Correctly include KSyntaxHighlighting headersDmitry Shachnev2022-05-241-1/+1
| | | | | | | | | | | | | | | | | | | In external KSyntaxHighlighting, these headers now have paths like /usr/include/KF5/KSyntaxHighlighting/KSyntaxHighlighting/AbstractHighlighter, where /usr/include/KF5/KSyntaxHighlighting is passed to compiler as include path. Old headers which had only one KSyntaxHighlighting fragment in path were removed in v5.94.0: https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/305 Adjust our vendored version to make the code work with both external and vendored versions. Change-Id: Iadcc668c3c705c563ae359301d227ee19eadca0f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Fix highlighting of raw string literalsChristian Kandeler2021-12-101-0/+6
| | | | | | | | | | | | ... with the built-in highlighter. Pass the necessary context information in and out of the SimpleLexer. Task-number: QTCREATORBUG-26211 Fixes: QTCREATORBUG-26425 Fixes: QTCREATORBUG-26615 Change-Id: Id72f743e07ae117ca51b0d5e527b208dda133b7e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Make some qHash and comparison operators overloads hidden friendshjk2021-12-061-5/+5
| | | | | | | Restricts lookup scope more to necessary bits. Change-Id: Ia42c95aaa70534843b7f6a90bfc56d2a1202c612 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: Provide a function for inserting a parenthesisChristian Kandeler2021-09-241-2/+2
| | | | | | | ... into a sorted list. Change-Id: Ibc39a345425945437cc8b8d9237589746143b2d9 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: update matching parenthesis in the editorDavid Schulz2021-09-241-0/+5
| | | | | | | | ... after updating the parenthesis in the layout Task-number: QTCREATORBUG-26183 Change-Id: I346046fbc3932b94227c1ac5bee6b0d7c44651e1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Clear outdated "semantic parentheses"Christian Kandeler2021-03-011-0/+3
| | | | | | | | | | For instance, if the user types "template<", then the next operator> in the source code will be temporarily classified as the closing angle bracket for that template. Therefore, we have to clear out any previous information of that kind. Change-Id: Ib6d64415b2f6294661e2b8ec48cbaea5893d8fd0 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Fix typo in a TextDocumentLayout functionNikolai Kosjar2019-12-181-1/+1
| | | | | Change-Id: I17153d9bfe9820f3ccc88f54bce1d494a522be33 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: replace generic highlighter with ksyntaxhighlightingDavid Schulz2019-01-281-0/+6
| | | | | | Fixes: QTCREATORBUG-21029 Change-Id: I9894c4384e0e47da6bf030b7b8e07c3ad4737ff3 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* TextEditor: ModernizeAlessandro Portale2018-11-301-1/+1
| | | | | | | | modernize-* Change-Id: Ic497fea1942a77cf017be3b0033f92e3807066f1 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io>
* TextEditor: ModernizeOrgad Shaneh2018-09-201-1/+1
| | | | | | | override, auto, nullptr, member initializers. Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: Use override consistentlyTobias Hunger2018-05-081-1/+1
| | | | | | | clang-tidy fixes from modernize-use-override check. Change-Id: Ie98c08279d7bf01f2705f631500dcabac5ba85d1 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Cleanup TextDocumentLayoutOrgad Shaneh2018-05-071-21/+18
| | | | | | | | | | * Use range-based for * Use nullptr * Use inline member initialization * Fix real/int implicit casts Change-Id: I17fc35382ef22c97b34faba741915b9b914e38ff Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Add option to display annotation between linesDavid Schulz2017-11-221-1/+6
| | | | | | | Task-number: QTCREATORBUG-19181 Change-Id: I9b3957c678c08ca2f3ddf9cfa5ff272241547471 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Add folding to Side-by-side diff editorJarek Kobus2017-11-011-0/+1
| | | | | | | | Add folding for files and chunks. Change-Id: I76476351e88f0b3e71e3cccbca0fa17b02c26226 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Wholesale conversion to #pragma oncehjk2016-03-301-4/+1
| | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Editor: Allow negative folding indent.David Schulz2015-05-211-8/+8
| | | | | | | | Fixing folding issues in the c++ editor if too many closing folding regions were found. Change-Id: I5c3476a6922af07be9b49d396b684a5f3b5a5e33 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* TextEditor: Optimize alignment in class ParenthesisNikolai Kosjar2015-05-131-5/+5
| | | | | | | Change-Id: I25d00a7d68fb85797c9d6edc5a3e70b698ce6b9b Task-number: QTCREATORBUG-14390 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Clean exported headers of the TextEditor plugin.Friedemann Kleint2015-02-261-1/+1
| | | | | Change-Id: I1e7dd34ba5a51fb0b34d137dc03add4457b32ed1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* TextEditor: Adapt include guard to file renameOrgad Shaneh2015-01-051-3/+3
| | | | | Change-Id: I1a7c677bd0fcee19780dfab02472f081cc22ace7 Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge remote-tracking branch 'origin/3.2'Eike Ziller2014-10-141-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* TextEditor: More BaseText* -> Text* renamingshjk2014-09-261-0/+231
*Document* and *Layout* classes, all basetext* files Change-Id: I1c6e376733a434fcb5c7f19c6210dfa031eeafde Reviewed-by: Eike Ziller <eike.ziller@digia.com>