Code Monkey home page Code Monkey logo

Comments (5)

andymass avatar andymass commented on May 30, 2024

Thank you for the very clear description; reproduced. 46f411c should fix it.

In retrospect, auto-transmute is quite dangerous because in some cases it is impossible to know what the desired change was. I am considering adding a mapping to trigger it instead.

from vim-matchup.

step- avatar step- commented on May 30, 2024

I agree, it can be dangerous. Still, I find it useful and will continue to use it.

in some cases it is impossible to know what the desired change was
Could the plugin identify such cases? If so it could prompt for directions or hold the change with a warning.

from vim-matchup.

step- avatar step- commented on May 30, 2024

Unfortunately this issue still happens with different XML test input.

        <variable>x</variable>
        
        <action>a ''</action>

which is

00000000: 0a20 2020 2020 2020 203c 7661 7269 6162  .        <variab
00000010: 6c65 3e78 3c2f 7661 7269 6162 6c65 3e0a  le>x</variable>.
00000020: 2020 2020 2020 2020 0a20 2020 2020 2020          .       
00000030: 203c 6163 7469 6f6e 3e61 2027 273c 2f61   <action>a ''</a
00000040: 6374 696f 6e3e 0a0a                      ction>..

To reproduce you need to place the cursor on the first "a" of <variable> then press j d d to end up with

        <variable>x</action>
        <action>a ''</action>

Sorry for keeping you busy on this.

from vim-matchup.

andymass avatar andymass commented on May 30, 2024

Thanks! ef17dcb should do it, hopefully it is not too careful now to miss actually useful text changes.

Could the plugin identify such cases?

I think it is likely possible with text-properties, which is a new feature in vim 8.1.0694, but still being worked on. However, if I go down this route, I won't be able to support old vim.

from vim-matchup.

step- avatar step- commented on May 30, 2024

This fix looks good here. Thank you!

from vim-matchup.

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.