Coder Social home page Coder Social logo

Comments (6)

raxod502 avatar raxod502 commented on July 4, 2024

No, aside from that it should be a similar interface to the one used in other text editors, but it does sound reasonable to add "replace" to "find".

from ctrlf.

dylanjm avatar dylanjm commented on July 4, 2024

I really like the anzu approaches find and replace by interactively highlighting the regexp as you type it in, and then shows an inline replacement after matching on the regexp.

from ctrlf.

raxod502 avatar raxod502 commented on July 4, 2024

Yeah, that's a nice interface. See also visual-regexp which implements a similar idea although not quite as attractively.

from ctrlf.

AmaiKinono avatar AmaiKinono commented on July 4, 2024

I'll write down a somewhat "corner" case here.

The one thing that pushed me to switch from ivy+swiper to selectrum+CTRLF is I found sometimes I need to find and replace ^$ (blank lines). There's bugs in swiper that make this don't work. Once it's fixed (in an ad-hoc way) and then there's regression that breaks this again.

I hope this works. Now CTRLF doesn't deal with zero-width matches, which make sense. But when it can do replace, I hope it works when I want to do this. Of course I can switch to isearch or query-replace-regexp to do this, but If the user already sticks to CTRLF, it would be a bonus if they can do all kinds of search/replace in it.

from ctrlf.

raxod502 avatar raxod502 commented on July 4, 2024

I didn't think of zero-length matches that only match at certain points of the buffer. I think that they're a reasonable thing to want to be supported, but somebody would have to do the work to make it so the code for them isn't a disgusting mess. It's also an open question how to indicate that a zero-length match is selected, since there are no characters to highlight.

from ctrlf.

raxod502 avatar raxod502 commented on July 4, 2024

Zero-length matches are now implemented, so all the machinery exists to support replacement as well. I do not plan to work on this anytime soon, however.

from ctrlf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.