Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Cursors - Preserve Case #106502

Open
brianblakely opened this issue Sep 11, 2020 · 8 comments
Open

Multiple Cursors - Preserve Case #106502

brianblakely opened this issue Sep 11, 2020 · 8 comments
Labels
editor-multicursor Editor multiple cursor issues feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities
Milestone

Comments

@brianblakely
Copy link

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:

  1. Select value.
  2. Press Ctrl+D.
  3. Type array.
  4. See that both symbols have changed, while preserving their proper casing.

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.

@bpasero bpasero added a11ymas Issue from accessibility team and removed a11ymas Issue from accessibility team labels Sep 28, 2020
@alexdima alexdima added editor-multicursor Editor multiple cursor issues feature-request Request for new features or functionality labels Sep 28, 2020
@andig
Copy link

andig commented Oct 5, 2020

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 ;)

@rebornix rebornix removed their assignment Nov 3, 2020
@alexdima alexdima removed their assignment Nov 16, 2020
@emanuel-lundman
Copy link

This should include cmd + shift + L, as well 🙂

@hediet hediet added *extension-candidate Issue identified as good extension implementation and removed *extension-candidate Issue identified as good extension implementation labels Oct 19, 2021
@hediet hediet reopened this Oct 19, 2021
@microsoft microsoft deleted a comment Oct 19, 2021
@hediet hediet added the help wanted Issues identified as good community contribution opportunities label Oct 19, 2021
@hediet
Copy link
Member

hediet commented Oct 19, 2021

I think it makes sense to have a button here (disabled by default):
image

The button should look the same as the button in the search widget:
image

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.

@andig
Copy link

andig commented Oct 19, 2021

I think there are two sub features hidden in this issue:

  • changing the way Cmd-D extends the selection (currently case-insensitive) and
  • changing the way Cmd-D multi-selection edits handle case when editing/overwriting the selection

It seems only the latter is scope of this issue while the former might actually be simpler to implement.

@hediet
Copy link
Member

hediet commented Oct 19, 2021

(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).

@andig
Copy link

andig commented Oct 19, 2021

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.

@hediet
Copy link
Member

hediet commented Oct 19, 2021

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

recording

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

recording

(from @alexdima)
Collapsed selection means a selection of length 0.

@berenar
Copy link

berenar commented Oct 3, 2023

Until this is not implemented, Multiple cursor case preserve extension does the trick 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-multicursor Editor multiple cursor issues feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

9 participants