diff --git a/helix-core/src/case_conversion.rs b/helix-core/src/case_conversion.rs index 99096f8d8..070b6e821 100644 --- a/helix-core/src/case_conversion.rs +++ b/helix-core/src/case_conversion.rs @@ -96,11 +96,11 @@ pub fn into_alternate_case(text: impl Iterator, buf: &mut Tendril) }); } -pub fn into_upper_case(text: impl Iterator, buf: &mut Tendril) { +pub fn into_uppercase(text: impl Iterator, buf: &mut Tendril) { simple_case_conversion(text, buf, char::to_ascii_uppercase); } -pub fn into_lower_case(text: impl Iterator, buf: &mut Tendril) { +pub fn into_lowercase(text: impl Iterator, buf: &mut Tendril) { simple_case_conversion(text, buf, char::to_ascii_lowercase); } @@ -137,12 +137,12 @@ pub fn to_camel_case(text: impl Iterator) -> Tendril { to_case(text, into_camel_case) } -pub fn to_lower_case(text: impl Iterator) -> Tendril { - to_case(text, into_lower_case) +pub fn to_lowercase(text: impl Iterator) -> Tendril { + to_case(text, into_lowercase) } -pub fn to_upper_case(text: impl Iterator) -> Tendril { - to_case(text, into_upper_case) +pub fn to_uppercase(text: impl Iterator) -> Tendril { + to_case(text, into_uppercase) } pub fn to_pascal_case(text: impl Iterator) -> Tendril { @@ -209,7 +209,7 @@ mod tests { ]; for (input, expected) in tests { - assert_eq!(to_lower_case(input.chars()), expected) + assert_eq!(to_lowercase(input.chars()), expected) } } @@ -231,7 +231,7 @@ mod tests { ]; for (input, expected) in tests { - assert_eq!(to_upper_case(input.chars()), expected) + assert_eq!(to_uppercase(input.chars()), expected) } } diff --git a/helix-core/src/snippets/elaborate.rs b/helix-core/src/snippets/elaborate.rs index 0ae5e4adf..fae46706f 100644 --- a/helix-core/src/snippets/elaborate.rs +++ b/helix-core/src/snippets/elaborate.rs @@ -10,8 +10,8 @@ use regex_cursor::engines::meta::Regex; use regex_cursor::regex_automata::util::syntax::Config as RegexConfig; use ropey::RopeSlice; -use crate::case_conversion::into_lower_case; -use crate::case_conversion::into_upper_case; +use crate::case_conversion::into_lowercase; +use crate::case_conversion::into_uppercase; use crate::case_conversion::{into_camel_case, into_pascal_case}; use crate::snippets::parser::{self, CaseChange, FormatItem}; use crate::snippets::{TabstopIdx, LAST_TABSTOP_IDX}; @@ -348,8 +348,8 @@ impl Transform { if let Some(cap) = cap.get_group(i).filter(|i| !i.is_empty()) { let mut chars = doc.byte_slice(cap.range()).chars(); match change { - CaseChange::Upcase => into_upper_case(chars, &mut buf), - CaseChange::Downcase => into_lower_case(chars, &mut buf), + CaseChange::Upcase => into_uppercase(chars, &mut buf), + CaseChange::Downcase => into_lowercase(chars, &mut buf), CaseChange::Capitalize => { let first_char = chars.next().unwrap(); buf.extend(first_char.to_uppercase()); diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 4e321a808..6c1075ac7 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -19,8 +19,8 @@ pub use typed::*; use helix_core::{ case_conversion::{ - to_alternate_case, to_camel_case, to_kebab_case, to_lower_case, to_pascal_case, - to_snake_case, to_title_case, to_upper_case, + to_alternate_case, to_camel_case, to_kebab_case, to_lowercase, to_pascal_case, + to_snake_case, to_title_case, to_uppercase, }, char_idx_at_visual_offset, chars::char_is_word, @@ -356,9 +356,9 @@ impl MappableCommand { extend_prev_char, "Extend to previous occurrence of char", repeat_last_motion, "Repeat last motion", replace, "Replace with new char", - switch_to_alternate_case, "Switch to aLTERNATE cASE", - switch_to_upper_case, "Switch to UPPERCASE", - switch_to_lower_case, "Switch to lowercase", + switch_case, "Switch to aLTERNATE cASE", + switch_to_uppercase, "Switch to UPPERCASE", + switch_to_lowercase, "Switch to lowercase", switch_to_pascal_case, "Switch to PascalCase", switch_to_camel_case, "Switch to camelCase", switch_to_title_case, "Switch to Title Case", @@ -1795,15 +1795,15 @@ fn switch_to_camel_case(cx: &mut Context) { switch_case_impl(cx, |chars| to_camel_case(chars)) } -fn switch_to_lower_case(cx: &mut Context) { - switch_case_impl(cx, |chars| to_lower_case(chars)) +fn switch_to_lowercase(cx: &mut Context) { + switch_case_impl(cx, |chars| to_lowercase(chars)) } -fn switch_to_upper_case(cx: &mut Context) { - switch_case_impl(cx, |chars| to_upper_case(chars)) +fn switch_to_uppercase(cx: &mut Context) { + switch_case_impl(cx, |chars| to_uppercase(chars)) } -fn switch_to_alternate_case(cx: &mut Context) { +fn switch_case(cx: &mut Context) { switch_case_impl(cx, |chars| to_alternate_case(chars)) } diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index 3a21594d2..250e3149a 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -19,10 +19,10 @@ pub fn default() -> HashMap { "R" => replace_with_yanked, "A-." => repeat_last_motion, - "~" => switch_to_alternate_case, + "~" => switch_case, "`" => { "Case" - "l" => switch_to_lower_case, - "u" => switch_to_upper_case, + "l" => switch_to_lowercase, + "u" => switch_to_uppercase, "p" => switch_to_pascal_case, "c" => switch_to_camel_case, "t" => switch_to_title_case,