diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-11-20 11:28:41 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-11-22 13:47:16 +0000 |
commit | 240748c106678218d7ed85e3a7a2d79db099b0e6 (patch) | |
tree | 4e872d9f67ddd6e18b0bc38e11a841b92bcb9f97 /src/plugins/texteditor/tabsettings.h | |
parent | 2bd02671d81dd550881cc7384d9bdf9d2bde4394 (diff) |
TextEditor: Get rid of extra indent ranges in RefactoringFile
Having extra indent regions complicates the interface, the
implementation and the calling code.
Instead, derive the indent regions from the change set and let callers
opt out for the relatively few cases where indentation is not desired.
Change-Id: I49d2854830a51778534ef260fb5c9f2c7685554a
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/tabsettings.h')
-rw-r--r-- | src/plugins/texteditor/tabsettings.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index 9a446738d0..6d9c08e626 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -5,11 +5,14 @@ #include "texteditor_global.h" -#include <utils/store.h> +#include <utils/filepath.h> #include <utils/qtcsettings.h> +#include <utils/store.h> #include <QTextBlock> +#include <functional> + namespace TextEditor { // Tab settings: Data type the GeneralSettingsPage acts on @@ -71,6 +74,10 @@ public: ContinuationAlignBehavior m_continuationAlignBehavior = ContinuationAlignWithSpaces; bool equals(const TabSettings &ts) const; + + using Retriever = std::function<TabSettings(const Utils::FilePath &)>; + static void setRetriever(const Retriever &retriever); + static TabSettings settingsForFile(const Utils::FilePath &filePath); }; } // namespace TextEditor |