Skip to content

Commit

Permalink
Apply clippy lints on textobject
Browse files Browse the repository at this point in the history
  • Loading branch information
sudormrfbin committed Jul 2, 2021
1 parent 94e2f3b commit 67f7b70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions helix-core/src/textobject.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use ropey::{Rope, RopeSlice};
use ropey::RopeSlice;

use crate::chars::{categorize_char, char_is_line_ending, char_is_whitespace, CharCategory};
use crate::movement::{self, Direction};
use crate::surround;
use crate::Range;

fn this_word_end_pos(slice: RopeSlice, mut pos: usize) -> usize {
fn this_word_end_pos(slice: RopeSlice, pos: usize) -> usize {
this_word_bound_pos(slice, pos, Direction::Forward)
}

fn this_word_start_pos(slice: RopeSlice, mut pos: usize) -> usize {
fn this_word_start_pos(slice: RopeSlice, pos: usize) -> usize {
this_word_bound_pos(slice, pos, Direction::Backward)
}

Expand Down Expand Up @@ -97,15 +97,6 @@ pub fn textobject_word(
Range::new(anchor, head)
}

pub fn textobject_paragraph(
slice: RopeSlice,
range: Range,
textobject: TextObject,
count: usize,
) -> Range {
Range::point(0)
}

pub fn textobject_surround(
slice: RopeSlice,
range: Range,
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,7 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
let (view, doc) = current!(cx.editor);
let text = doc.text().slice(..);

let selection = doc.selection(view.id).transform(|mut range| {
let selection = doc.selection(view.id).transform(|range| {
match ch {
'w' => textobject::textobject_word(text, range, objtype, count),
// TODO: cancel new ranges if inconsistent surround matches across lines
Expand Down

0 comments on commit 67f7b70

Please sign in to comment.