@@ -10,7 +10,7 @@ use crate::surround;
1010use crate::syntax::LanguageConfiguration;
1111use crate::Range;
1212
13−fn find_word_boundary(slice: RopeSlice, mut pos: usize, direction: Direction) -> usize {
13+fn find_word_boundary(slice: RopeSlice, mut pos: usize, direction: Direction, long: bool) -> usize {
1414 use CharCategory::{Eol, Whitespace};
1515
1616 let iter = match direction {
@@ -33,7 +33,7 @@ fn find_word_boundary(slice: RopeSlice, mut pos: usize, direction: Direction) ->
3333 match categorize_char(ch) {
3434 Eol | Whitespace => return pos,
3535 category => {
36− if category != prev_category && pos != 0 && pos != slice.len_chars() {
36+ if !long && category != prev_category && pos != 0 && pos != slice.len_chars() {
3737 return pos;
3838 } else {
3939 match direction {
@@ -70,13 +70,14 @@ pub fn textobject_word(
7070 range: Range,
7171 textobject: TextObject,
7272 _count: usize,
73+ long: bool,
7374) -> Range {
7475 let pos = range.cursor(slice);
7576
76− let word_start = find_word_boundary(slice, pos, Direction::Backward);
77+ let word_start = find_word_boundary(slice, pos, Direction::Backward, long);
7778 let word_end = match slice.get_char(pos).map(categorize_char) {
7879 None | Some(CharCategory::Whitespace | CharCategory::Eol) => pos,
79− _ => find_word_boundary(slice, pos + 1, Direction::Forward),
80+ _ => find_word_boundary(slice, pos + 1, Direction::Forward, long),
8081 };
8182
8283 // Special case.
@@ -268,7 +269,7 @@ mod test {
268269 let slice = doc.slice(..);
269270 for &case in scenario {
270271 let (pos, objtype, expected_range) = case;
271− let result = textobject_word(slice, Range::point(pos), objtype, 1);
272+ let result = textobject_word(slice, Range::point(pos), objtype, 1, false);
272273 assert_eq!(
273274 result,
274275 expected_range.into(),