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

replace is inconsistent with find and useless for large files #1732

Open
HJarausch opened this issue Jun 18, 2020 · 1 comment
Open

replace is inconsistent with find and useless for large files #1732

HJarausch opened this issue Jun 18, 2020 · 1 comment

Comments

@HJarausch
Copy link

Version 2.04

OS: Termux
Terminal: Termux

  1. backslashes have to be doubled (in a regexl contrary to the find command
  2. independent of the cursor position, replace always starts at the first line of the file. Using it on a file of several thousands of lines is impractical therefore
@zyedidia
Copy link
Owner

zyedidia commented Jun 18, 2020

Micro uses the same rules as the shell to parse command bar arguments. This causes the annoying problem that backslashes have to be doubled to be escaped once as a command argument and then again for when they are passed into the regexp engine. One solution is to use single quotes instead of double quotes which causes literal parsing at the shell level. So you can use > replace '\\' backslash to replace all \ characters with backslash.

Regarding point 2, this was just reported and fixed in #1731. Also note that if you make a selection, search and replace will only happen in the selected region.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants