Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
Unreleased
==========
- feat: add `.` command to repeat the last change (dot-repeat)

- fix: count hyphen as punctuation

Released
--------

0.11.5 - 2026-07-18
===================

- feat: add `.` command to repeat the last change (dot-repeat)

0.11.4 - 2026-07-18
===================
- feat: add bindings for delete word and delete big word @acerv
Expand Down
3 changes: 2 additions & 1 deletion src/actions/motion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ pub(crate) enum CharacterClass {

impl From<&char> for CharacterClass {
fn from(value: &char) -> Self {
if value.is_ascii_alphanumeric() {
// Underscore counts as a word character (matching Vim's `iskeyword`),
if value.is_ascii_alphanumeric() || *value == '_' {
return Self::Alphanumeric;
}
if value.is_ascii_punctuation() {
Expand Down
26 changes: 26 additions & 0 deletions src/actions/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,32 @@ mod tests {
assert_eq!(state.mode, EditorMode::Normal);
}

#[test]
fn test_select_inner_word_includes_underscores() {
// Underscore is a word character, so `viw` on the `B` of `BY` selects
// the whole identifier (matching Vim/nvim).
let mut state = EditorState::new(Lines::from("ORDER_BY_FIELD"));
state.cursor = Index2::new(0, 6);

SelectInnerWord.execute(&mut state);

let want = Selection::new(Index2::new(0, 0), Index2::new(0, 13));
assert_eq!(state.selection.unwrap(), want);
}

#[test]
fn test_select_inner_word_stops_at_hyphen() {
// A hyphen is punctuation, so `viw` on the `B` of `BY` selects only
// `BY` (matching Vim/nvim).
let mut state = EditorState::new(Lines::from("ORDER-BY"));
state.cursor = Index2::new(0, 6);

SelectInnerWord.execute(&mut state);

let want = Selection::new(Index2::new(0, 6), Index2::new(0, 7));
assert_eq!(state.selection.unwrap(), want);
}

#[test]
fn test_select_inner_big_word() {
let mut state = EditorState::new(Lines::from("foo.bar baz"));
Expand Down
Loading