mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-08-15 13:40:32 +03:00
Merge pull request #751 from mwerle/feature/editor-show-whitespace
feat: add an option to render whitespace in the diff and editor views
This commit is contained in:
commit
39ccb2661c
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,4 +10,4 @@ build
|
|||||||
.idea/
|
.idea/
|
||||||
.venv
|
.venv
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
tags
|
@ -14,6 +14,9 @@ return {
|
|||||||
family = family,
|
family = family,
|
||||||
size = size
|
size = size
|
||||||
},
|
},
|
||||||
|
view = {
|
||||||
|
showWhitespace = false
|
||||||
|
},
|
||||||
indent = {
|
indent = {
|
||||||
tabs = true,
|
tabs = true,
|
||||||
width = 4,
|
width = 4,
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@ void Setting::initialize(QMap<Id, QString> &keys) {
|
|||||||
keys[Id::IndentWidth] = "editor/indent/width";
|
keys[Id::IndentWidth] = "editor/indent/width";
|
||||||
keys[Id::TabWidth] = "editor/indent/tabwidth";
|
keys[Id::TabWidth] = "editor/indent/tabwidth";
|
||||||
keys[Id::ShowHeatmapInBlameMargin] = "editor/blame/heatmap";
|
keys[Id::ShowHeatmapInBlameMargin] = "editor/blame/heatmap";
|
||||||
|
keys[Id::ShowWhitespaceInEditor] = "editor/view/showWhitespace";
|
||||||
keys[Id::ColorTheme] = "window/theme";
|
keys[Id::ColorTheme] = "window/theme";
|
||||||
keys[Id::ShowFullRepoPath] = "window/path/full";
|
keys[Id::ShowFullRepoPath] = "window/path/full";
|
||||||
keys[Id::HideLogAutomatically] = "window/log/hide";
|
keys[Id::HideLogAutomatically] = "window/log/hide";
|
||||||
|
@ -36,6 +36,7 @@ public:
|
|||||||
IndentWidth,
|
IndentWidth,
|
||||||
TabWidth,
|
TabWidth,
|
||||||
ShowHeatmapInBlameMargin,
|
ShowHeatmapInBlameMargin,
|
||||||
|
ShowWhitespaceInEditor,
|
||||||
ColorTheme,
|
ColorTheme,
|
||||||
ShowFullRepoPath,
|
ShowFullRepoPath,
|
||||||
HideLogAutomatically,
|
HideLogAutomatically,
|
||||||
|
@ -661,6 +661,14 @@ public:
|
|||||||
Settings::instance()->setValue(Setting::Id::FontSize, i);
|
Settings::instance()->setValue(Setting::Id::FontSize, i);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QCheckBox *showWhitespace = new QCheckBox(tr("Show whitespace"), this);
|
||||||
|
showWhitespace->setChecked(
|
||||||
|
settings->value(Setting::Id::ShowWhitespaceInEditor).toBool());
|
||||||
|
connect(showWhitespace, &QCheckBox::toggled, [](bool checked) {
|
||||||
|
Settings::instance()->setValue(Setting::Id::ShowWhitespaceInEditor,
|
||||||
|
checked);
|
||||||
|
});
|
||||||
|
|
||||||
QComboBox *indent = new QComboBox(this);
|
QComboBox *indent = new QComboBox(this);
|
||||||
indent->addItem(tr("Tabs"));
|
indent->addItem(tr("Tabs"));
|
||||||
indent->addItem(tr("Spaces"));
|
indent->addItem(tr("Spaces"));
|
||||||
@ -695,6 +703,7 @@ public:
|
|||||||
QFormLayout *layout = new QFormLayout(this);
|
QFormLayout *layout = new QFormLayout(this);
|
||||||
layout->addRow(tr("Font:"), font);
|
layout->addRow(tr("Font:"), font);
|
||||||
layout->addRow(tr("Font size:"), fontSize);
|
layout->addRow(tr("Font size:"), fontSize);
|
||||||
|
layout->addRow(tr("Whitespace:"), showWhitespace);
|
||||||
layout->addRow(tr("Indent using:"), indent);
|
layout->addRow(tr("Indent using:"), indent);
|
||||||
layout->addRow(tr("Indent width:"), indentWidth);
|
layout->addRow(tr("Indent width:"), indentWidth);
|
||||||
layout->addRow(tr("Tab width:"), tabWidth);
|
layout->addRow(tr("Tab width:"), tabWidth);
|
||||||
|
@ -182,6 +182,7 @@ void TextEditor::applySettings() {
|
|||||||
setUseTabs(settings->value(Setting::Id::UseTabsForIndent).toBool());
|
setUseTabs(settings->value(Setting::Id::UseTabsForIndent).toBool());
|
||||||
setIndent(settings->value(Setting::Id::IndentWidth).toInt());
|
setIndent(settings->value(Setting::Id::IndentWidth).toInt());
|
||||||
setTabWidth(settings->value(Setting::Id::TabWidth).toInt());
|
setTabWidth(settings->value(Setting::Id::TabWidth).toInt());
|
||||||
|
setViewWS(settings->value(Setting::Id::ShowWhitespaceInEditor).toBool());
|
||||||
|
|
||||||
if (Settings::instance()->isTextEditorWrapLines()) {
|
if (Settings::instance()->isTextEditorWrapLines()) {
|
||||||
setWrapMode(SC_WRAP_WORD);
|
setWrapMode(SC_WRAP_WORD);
|
||||||
|
Loading…
Reference in New Issue
Block a user