mirror of https://github.com/buggins/dlangide.git
refactoring
This commit is contained in:
parent
e95a94fcc6
commit
e8bc87380e
|
@ -1,6 +1,6 @@
|
|||
module app;
|
||||
|
||||
import dlangui.all;
|
||||
import dlangui;
|
||||
import std.stdio;
|
||||
import std.conv;
|
||||
import dlangide.ui.frame;
|
||||
|
|
|
@ -8,7 +8,7 @@ import ddc.lexer.textsource;
|
|||
import ddc.lexer.exceptions;
|
||||
import ddc.lexer.tokenizer;
|
||||
|
||||
class SimpleDSyntaxHighlighter : SyntaxHighlighter {
|
||||
class SimpleDSyntaxSupport : SyntaxSupport {
|
||||
|
||||
EditableContent _content;
|
||||
SourceFile _file;
|
||||
|
@ -26,7 +26,7 @@ class SimpleDSyntaxHighlighter : SyntaxHighlighter {
|
|||
/// returns editable content
|
||||
@property EditableContent content() { return _content; }
|
||||
/// set editable content
|
||||
@property SyntaxHighlighter content(EditableContent content) {
|
||||
@property SyntaxSupport content(EditableContent content) {
|
||||
_content = content;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class DSourceEdit : SourceEdit {
|
|||
override bool load(string fn) {
|
||||
_projectSourceFile = null;
|
||||
bool res = super.load(fn);
|
||||
setHighlighter();
|
||||
setSyntaxSupport();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -70,11 +70,11 @@ class DSourceEdit : SourceEdit {
|
|||
return filename.endsWith(".d") || filename.endsWith(".dd") || filename.endsWith(".dh") || filename.endsWith(".ddoc");
|
||||
}
|
||||
|
||||
void setHighlighter() {
|
||||
void setSyntaxSupport() {
|
||||
if (isDSourceFile) {
|
||||
content.syntaxHighlighter = new SimpleDSyntaxHighlighter(filename);
|
||||
content.syntaxSupport = new SimpleDSyntaxSupport(filename);
|
||||
} else {
|
||||
content.syntaxHighlighter = null;
|
||||
content.syntaxSupport = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ class DSourceEdit : SourceEdit {
|
|||
return false;
|
||||
}
|
||||
_projectSourceFile = f;
|
||||
setHighlighter();
|
||||
setSyntaxSupport();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue