Reuse len functions
@@ -186,7 +186,7 @@ pub fn to_string(&self) -> String {
}
pub fn num_lines(&self) -> usize {
- self.line_of_offset(self.text.len()) + 1
+ self.line_of_offset(self.len()) + 1
}
fn get_max_line_len(&self) -> (usize, usize) {
@@ -678,7 +678,7 @@ pub fn do_redo(
}
pub fn last_line(&self) -> usize {
- self.line_of_offset(self.text.len())
+ self.line_of_offset(self.len())
}
pub fn offset_of_line(&self, line: usize) -> usize {
@@ -1025,7 +1025,7 @@ pub fn is_empty(&self) -> bool {
}
pub fn last_line(&self) -> usize {
- self.line_of_offset(self.text.len())
+ self.line_of_offset(self.len())
}
pub fn offset_of_line(&self, line: usize) -> usize {
