SyntaxEditor: Support using two-face syntax definitions
This commit is contained in:
parent
ac389d9eeb
commit
e62fea5efd
2 changed files with 17 additions and 4 deletions
|
|
@ -22,6 +22,7 @@ pub struct SyntaxSystem {
|
|||
|
||||
impl SyntaxSystem {
|
||||
/// Create a new [`SyntaxSystem`]
|
||||
#[cfg(not(feature = "two-face"))]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
//TODO: store newlines in buffer
|
||||
|
|
@ -29,6 +30,17 @@ impl SyntaxSystem {
|
|||
theme_set: ThemeSet::load_defaults(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new [`SyntaxSystem`] using `[two-face]` definitions
|
||||
#[cfg(feature = "two-face")]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
//TODO: store newlines in buffer
|
||||
syntax_set: two_face::syntax::extra_no_newlines(),
|
||||
//TODO: use two-face themes
|
||||
theme_set: ThemeSet::load_defaults(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A wrapper of [`Editor`] with syntax highlighting provided by [`SyntaxSystem`]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue