mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-07-14 14:00:25 +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/
|
||||
.venv
|
||||
compile_commands.json
|
||||
|
||||
tags
|
@ -14,6 +14,9 @@ return {
|
||||
family = family,
|
||||
size = size
|
||||
},
|
||||
view = {
|
||||
showWhitespace = false
|
||||
},
|
||||
indent = {
|
||||
tabs = true,
|
||||
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::TabWidth] = "editor/indent/tabwidth";
|
||||
keys[Id::ShowHeatmapInBlameMargin] = "editor/blame/heatmap";
|
||||
keys[Id::ShowWhitespaceInEditor] = "editor/view/showWhitespace";
|
||||
keys[Id::ColorTheme] = "window/theme";
|
||||
keys[Id::ShowFullRepoPath] = "window/path/full";
|
||||
keys[Id::HideLogAutomatically] = "window/log/hide";
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
IndentWidth,
|
||||
TabWidth,
|
||||
ShowHeatmapInBlameMargin,
|
||||
ShowWhitespaceInEditor,
|
||||
ColorTheme,
|
||||
ShowFullRepoPath,
|
||||
HideLogAutomatically,
|
||||
|
@ -661,6 +661,14 @@ public:
|
||||
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);
|
||||
indent->addItem(tr("Tabs"));
|
||||
indent->addItem(tr("Spaces"));
|
||||
@ -695,6 +703,7 @@ public:
|
||||
QFormLayout *layout = new QFormLayout(this);
|
||||
layout->addRow(tr("Font:"), font);
|
||||
layout->addRow(tr("Font size:"), fontSize);
|
||||
layout->addRow(tr("Whitespace:"), showWhitespace);
|
||||
layout->addRow(tr("Indent using:"), indent);
|
||||
layout->addRow(tr("Indent width:"), indentWidth);
|
||||
layout->addRow(tr("Tab width:"), tabWidth);
|
||||
|
@ -182,6 +182,7 @@ void TextEditor::applySettings() {
|
||||
setUseTabs(settings->value(Setting::Id::UseTabsForIndent).toBool());
|
||||
setIndent(settings->value(Setting::Id::IndentWidth).toInt());
|
||||
setTabWidth(settings->value(Setting::Id::TabWidth).toInt());
|
||||
setViewWS(settings->value(Setting::Id::ShowWhitespaceInEditor).toBool());
|
||||
|
||||
if (Settings::instance()->isTextEditorWrapLines()) {
|
||||
setWrapMode(SC_WRAP_WORD);
|
||||
|
Loading…
Reference in New Issue
Block a user