diff options
Diffstat (limited to 'graphics/src/text/editor.rs')
| -rw-r--r-- | graphics/src/text/editor.rs | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/graphics/src/text/editor.rs b/graphics/src/text/editor.rs index 3e6ef70c..80733bbb 100644 --- a/graphics/src/text/editor.rs +++ b/graphics/src/text/editor.rs @@ -82,6 +82,13 @@ impl editor::Editor for Editor {          })))      } +    fn is_empty(&self) -> bool { +        let buffer = self.buffer(); + +        buffer.lines.is_empty() +            || (buffer.lines.len() == 1 && buffer.lines[0].text().is_empty()) +    } +      fn line(&self, index: usize) -> Option<&str> {          self.buffer()              .lines | 
