diff options
-rw-r--r-- | plugin/casefmt.vim | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/plugin/casefmt.vim b/plugin/casefmt.vim index ed85fb3..4824092 100644 --- a/plugin/casefmt.vim +++ b/plugin/casefmt.vim @@ -82,18 +82,12 @@ endfunction " tries to be smart about detecting the current case format and converting it " properly. function! s:to_snake(s) abort - if a:s =~ '^[A-Z_]*$' || a:s =~ '_' - " This is in constant case or is already in some flavor of snake_case. - " return whatever it is, but to lower. - return tolower(a:s) - endif - if a:s =~ '[a-z][A-Z]' " a:s has a camel case boundary in it. return tolower(substitute(a:s, '\%([a-zA-Z]\)\zs\ze\([A-Z0-9]\)', '_', "g")) endif - return a:s + return tolower(a:s) endfunction function s:to_upper_snake(s) abort |