Open brianblakely opened 4 years ago
Great requirement! I'm seeing this all the time when renaming across variables, types and functions.
I'd also- on a similar note- be able to keep the local casing during case-insensitive search/replace. I realise this is already possible. I'm having trouble keeping up ;)
This should include cmd
+ shift
+ L
, as well 🙂
I think it makes sense to have a button here (disabled by default):
The button should look the same as the button in the search widget:
The state of this button would apply whenever there is one or many selections and the user enters a character. If this feature is enabled and the selection starts with a captial letter, the new letter that is going to replace the selected text will also be capitalized.
I think there are two sub features hidden in this issue:
Cmd-D
extends the selection (currently case-insensitive) andCmd-D
multi-selection edits handle case when editing/overwriting the selectionIt seems only the latter is scope of this issue while the former might actually be simpler to implement.
(currently case-insensitive)
It is case-sensitive when you also selected the first selection with Cmd+D. If you manually selected the first selection, it is case-insensitive (if you did not enable case-sensitivity in your last Cmd+f search).
It is case-sensitive when you also selected the first selection with Cmd+D.
I don't follow. How can I select the first selection with Cmd-D? Imho Cmd-D expands the current selection with an additional cursor? Would be great if you could explain.
if you begin with a collapsed selection and press ctrl+d then the selection expands to the current word and for as long as you continue pressing ctrl+d, whole word and match case will be on
if you begin with a non-collapsed selection and press ctrl+d, then the modifiers are taken from the last state of the find widget
(from @alexdima) Collapsed selection means a selection of length 0.
Until this is not implemented, Multiple cursor case preserve extension does the trick 👍
Use Case Take the following:
const [value, setValue] = useState();
I want to change it to:
const [array, setArray] = useState();
Feature Ask It would be great to:
value
.Ctrl+D
.array
.Right now, I need to conduct two edit operations to do this. Alternatively, I can use a single Find & Replace operation, but that would be disproportionately time-consuming for this task, as well as less precise.