Setting for showing white space marks in editors - close #102

This commit is contained in:
Vadim Lopatin 2016-01-22 14:58:29 +03:00
parent 37b50254c5
commit 6fdb8812c4
5 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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"
},

View File

@ -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;

View File

@ -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));

View File

@ -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