mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-10-26 19:24:31 +03:00
[find-and-replace] Fix capitalize
utility
This commit is contained in:
parent
39784f11a7
commit
3dc198aca7
@ -36,7 +36,10 @@ showIf = (condition) ->
|
|||||||
else
|
else
|
||||||
{display: 'none'}
|
{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())
|
titleize = (str) -> str.toLowerCase().replace(/(?:^|\s)\S/g, (capital) -> capital.toUpperCase())
|
||||||
|
|
||||||
preserveCase = (text, reference) ->
|
preserveCase = (text, reference) ->
|
||||||
|
@ -139,7 +139,7 @@
|
|||||||
"preserveCaseOnReplace": {
|
"preserveCaseOnReplace": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false,
|
"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'."
|
"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