From 6fdb8812c4876daec9f9405d0fb4cbee2ef5c004 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Fri, 22 Jan 2016 14:58:29 +0300 Subject: [PATCH] Setting for showing white space marks in editors - close #102 --- README.md | 1 + dub.json | 2 +- src/dlangide/ui/dsourceedit.d | 4 +++- src/dlangide/ui/settings.d | 1 + src/dlangide/workspace/idesettings.d | 6 ++++++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff8eb02..c526fb1 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Build and run with DUB: If you see build errors, try to upgrade dependencies: + dub clean-caches dub upgrade --force-remove dub build --force diff --git a/dub.json b/dub.json index ab5e981..0bf1a76 100644 --- a/dub.json +++ b/dub.json @@ -12,7 +12,7 @@ "stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"], "dependencies": { - "dlangui": "~>0.7.44", + "dlangui": "~>0.7.46", "dcd": "~>0.7.5" }, diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index aca5c62..4a0943a 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -46,7 +46,8 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener { //ACTION_GO_TO_DEFINITION, ACTION_GET_COMPLETIONS popupMenu = editPopupItem; showIcons = true; - showFolding = true; + //showFolding = true; + showWhiteSpaceMarks = true; content.marksChanged = this; } @@ -85,6 +86,7 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener { useSpacesForTabs = _settings.useSpacesForTabs; smartIndents = _settings.smartIndents; smartIndentsAfterPaste = _settings.smartIndentsAfterPaste; + showWhiteSpaceMarks = _settings.showWhiteSpaceMarks; } protected EditorTool _editorTool; diff --git a/src/dlangide/ui/settings.d b/src/dlangide/ui/settings.d index bf7b654..979b542 100644 --- a/src/dlangide/ui/settings.d +++ b/src/dlangide/ui/settings.d @@ -20,6 +20,7 @@ SettingsPage createSettingsPages() { texted.addCheckbox("editors/textEditor/useSpacesForTabs", UIString("Use spaces for tabs"d)); texted.addCheckbox("editors/textEditor/smartIndents", UIString("Smart indents"d)); texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString("Smart indent after paste"d)); + texted.addCheckbox("editors/textEditor/showWhiteSpaceMarks", UIString("Show white space marks"d)); SettingsPage dlang = res.addChild("dlang", UIString("D"d)); SettingsPage dub = dlang.addChild("dlang/dub", UIString("DUB"d)); diff --git a/src/dlangide/workspace/idesettings.d b/src/dlangide/workspace/idesettings.d index 49e8313..aa0ba92 100644 --- a/src/dlangide/workspace/idesettings.d +++ b/src/dlangide/workspace/idesettings.d @@ -19,6 +19,7 @@ class IDESettings : SettingsFile { ed.setIntegerDef("tabSize", 4); ed.setBooleanDef("smartIndents", true); ed.setBooleanDef("smartIndentsAfterPaste", true); + ed.setBooleanDef("showWhiteSpaceMarks", true); Setting ui = uiSettings(); ui.setStringDef("theme", "ide_theme_default"); ui.setStringDef("language", "en"); @@ -133,6 +134,11 @@ class IDESettings : SettingsFile { /// set smart indents enabled flag @property IDESettings smartIndents(bool enabled) { editorSettings.setBoolean("smartIndents", enabled); return this; } + /// true if smart indents are enabled + @property bool showWhiteSpaceMarks() { return editorSettings.getBoolean("showWhiteSpaceMarks", true); } + /// set smart indents enabled flag + @property IDESettings showWhiteSpaceMarks(bool enabled) { editorSettings.setBoolean("showWhiteSpaceMarks", enabled); return this; } + /// true if smart indents are enabled @property bool smartIndentsAfterPaste() { return editorSettings.getBoolean("smartIndentsAfterPaste", true); } /// set smart indents enabled flag