Skip to content

Commit 03cc365

Browse files
authored
run next_back instead of last (#902)
1 parent cc79605 commit 03cc365

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core_editor/line_buffer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl LineBuffer {
163163
pub fn grapheme_left_index(&self) -> usize {
164164
self.lines[..self.insertion_point]
165165
.grapheme_indices(true)
166-
.last()
166+
.next_back()
167167
.map(|(i, _)| i)
168168
.unwrap_or(0)
169169
}
@@ -213,7 +213,7 @@ impl LineBuffer {
213213
.unwrap_or_else(|| {
214214
self.lines
215215
.grapheme_indices(true)
216-
.last()
216+
.next_back()
217217
.map(|x| x.0)
218218
.unwrap_or(0)
219219
})
@@ -238,7 +238,7 @@ impl LineBuffer {
238238
.unwrap_or_else(|| {
239239
self.lines
240240
.grapheme_indices(true)
241-
.last()
241+
.next_back()
242242
.map(|x| x.0)
243243
.unwrap_or(0)
244244
})
@@ -272,7 +272,7 @@ impl LineBuffer {
272272
self.lines[..self.insertion_point]
273273
.split_word_bound_indices()
274274
.filter(|(_, word)| !is_whitespace_str(word))
275-
.last()
275+
.next_back()
276276
.map(|(i, _)| i)
277277
.unwrap_or(0)
278278
}
@@ -471,7 +471,7 @@ impl LineBuffer {
471471
let left_index = self.lines[..right_index]
472472
.split_word_bound_indices()
473473
.filter(|(_, word)| !is_whitespace_str(word))
474-
.last()
474+
.next_back()
475475
.map(|(i, _)| i)
476476
.unwrap_or(0);
477477

0 commit comments

Comments
 (0)