aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorJan Hrastnik2021-06-19 12:05:11 +0000
committerJan Hrastnik2021-06-19 12:05:11 +0000
commit97323dc2f90f81afc82bd929d111abda540bebe5 (patch)
treec9070e906c2d959deb539bbd7eecd17edab94a5f /helix-term
parentecb884db98fbe6ed70743d1080ce7f78e121ba50 (diff)
ran cargo fmt
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index d894a646..463869f6 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1,11 +1,11 @@
use helix_core::{
- comment, coords_at_pos, find_first_non_whitespace_char, find_root, graphemes, indent,
- match_brackets,
+ comment, coords_at_pos, find_first_non_whitespace_char, find_root, get_line_ending, graphemes,
+ indent, match_brackets,
movement::{self, Direction},
object, pos_at_coords,
regex::{self, Regex},
register::{self, Register, Registers},
- search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeSlice, Selection, get_line_ending,
+ search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeSlice, Selection,
SmallVec, Tendril, Transaction,
};
@@ -183,9 +183,11 @@ pub fn move_line_end(cx: &mut Context) {
let text = doc.text();
let line = text.char_to_line(range.head);
- let pos = text
- .line_to_char(line + 1)
- .saturating_sub(get_line_ending(&text.line(line)).map(|le| le.len_chars()).unwrap_or(0));
+ let pos = text.line_to_char(line + 1).saturating_sub(
+ get_line_ending(&text.line(line))
+ .map(|le| le.len_chars())
+ .unwrap_or(0),
+ );
Range::new(pos, pos)
});
@@ -606,9 +608,11 @@ pub fn extend_line_end(cx: &mut Context) {
let text = doc.text();
let line = text.char_to_line(range.head);
- let pos = text
- .line_to_char(line + 1)
- .saturating_sub(get_line_ending(&text.line(line)).map(|le| le.len_chars()).unwrap_or(0));
+ let pos = text.line_to_char(line + 1).saturating_sub(
+ get_line_ending(&text.line(line))
+ .map(|le| le.len_chars())
+ .unwrap_or(0),
+ );
Range::new(range.anchor, pos)
});