mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-08-17 07:00:22 +03:00
[find-and-replace] Fix capitalize
utility
This commit is contained in:
parent
39784f11a7
commit
3dc198aca7
@ -36,7 +36,10 @@ showIf = (condition) ->
|
||||
else
|
||||
{display: 'none'}
|
||||
|
||||
capitalize = (str) -> str[0].toUpperCase() + str.toLowerCase().slice(1)
|
||||
capitalize = (str) ->
|
||||
return '' if str == ''
|
||||
str[0].toUpperCase() + str.toLowerCase().slice(1)
|
||||
|
||||
titleize = (str) -> str.toLowerCase().replace(/(?:^|\s)\S/g, (capital) -> capital.toUpperCase())
|
||||
|
||||
preserveCase = (text, reference) ->
|
||||
|
@ -139,7 +139,7 @@
|
||||
"preserveCaseOnReplace": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"title": "Preserve case during replace.",
|
||||
"title": "Preserve Case During Replace",
|
||||
"description": "Keep the replaced text case during replace: replacing 'user' with 'person' will replace 'User' with 'Person' and 'USER' with 'PERSON'."
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user