Skip to content

Conversation

Himura2la
Copy link
Contributor

@Himura2la Himura2la commented Jan 17, 2023

This is a major usability issue for me, because by workflow often looks like this:

  1. Select smth
  2. Call the find-replace:replace command
  3. Confirm the auto-filled search term
  4. Enter the replacement term (often based on the search term)
  5. Expect the replacement to occur in the whole file

The "replace in selection" feature is good, but it's not required so often as global replacement. And the global replacement is currently possible only if there's no selection while calling the find-replace:replace, which is not convenient at all (copy-pasting sucks).

As a workaround for scoped replacement, I like to copy a part of my text to another file, replace there and get it back.

closes #1225

@sammy-ette
Copy link
Contributor

this is a feature that I've always wanted personally so thanks. can you add "closes #1225" in the description (or a maintainer could) since that's the issue I opened for it

@Guldoman
Copy link
Member

Would you mind also adding a find-replace:replace-in-selection command to keep the functionality?
To be honest the main issue is that Doc.replace doesn't have a parameter to ignore the selections and that should probably be added.
Otherwise a good idea could be using Doc.replace_cursor directly instead.

@Himura2la Himura2la changed the title Replace globally when replacing from selection Replace globally when replacing from selection (closes #1225) Jan 18, 2023
@Himura2la Himura2la changed the title Replace globally when replacing from selection (closes #1225) Replace globally when replacing from selection Jan 18, 2023
@jgmdev
Copy link
Member

jgmdev commented Jan 30, 2023

this functionality seems more intuitive will merge to keep things moving and add Guldo suggestion of find-replace:replace-in-selection to also keep that essential feature.

@jgmdev jgmdev merged commit 0a0754d into lite-xl:master Jan 30, 2023
jgmdev added a commit to jgmdev/lite-xl that referenced this pull request Jan 30, 2023
jgmdev added a commit to jgmdev/lite-xl that referenced this pull request Jan 30, 2023
takase1121 pushed a commit to takase1121/lite-xl that referenced this pull request Aug 19, 2023
takase1121 pushed a commit to takase1121/lite-xl that referenced this pull request Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

selecting text then replacing should replace more than the selected text
4 participants