diff --git a/crates/vim/src/normal/case.rs b/crates/vim/src/normal/case.rs index 049df4bb27..db33e48c34 100644 --- a/crates/vim/src/normal/case.rs +++ b/crates/vim/src/normal/case.rs @@ -8,7 +8,7 @@ use crate::{ }; pub fn change_case(_: &mut Workspace, _: &ChangeCase, cx: &mut ViewContext) { - transform_case(cx, |c| { + manipulate_text(cx, |c| { if c.is_lowercase() { c.to_uppercase().collect::>() } else { @@ -22,7 +22,7 @@ pub fn convert_to_upper_case( _: &ConvertToUpperCase, cx: &mut ViewContext, ) { - transform_case(cx, |c| c.to_uppercase().collect::>()) + manipulate_text(cx, |c| c.to_uppercase().collect::>()) } pub fn convert_to_lower_case( @@ -30,10 +30,10 @@ pub fn convert_to_lower_case( _: &ConvertToLowerCase, cx: &mut ViewContext, ) { - transform_case(cx, |c| c.to_lowercase().collect::>()) + manipulate_text(cx, |c| c.to_lowercase().collect::>()) } -fn transform_case(cx: &mut ViewContext, transform: F) +fn manipulate_text(cx: &mut ViewContext, transform: F) where F: Fn(char) -> Vec + Copy, {