Coder Social home page Coder Social logo

Comments (10)

terryma avatar terryma commented on August 23, 2024

This is unexpected. Could you please post the text that you tested this on? Did you press l or L and did you remap the key to something else?

from vim-multiple-cursors.

d11wtq avatar d11wtq commented on August 23, 2024

I've figured it out. If you try and move beyond the end of the line (i.e. press l too many times) then it breaks. Therefore, by side-effect, if you select multiple lines where any of those lines are blank, the moment you hit l it breaks.

foo
bar
zip
button

Select all the above lines, then press ctrl-n.

Here you can select them and move left/right fine, within 3 characters. If you go beyond the end of the foo, bar or zip lines, however, the plugin breaks as described above.

foo

bar
zip

Now select all of those lines. If you try to move either left or right (h or l) thing break immediately, due to the blank line.

from vim-multiple-cursors.

d11wtq avatar d11wtq commented on August 23, 2024

This also affects trying to move left of column zero.

from vim-multiple-cursors.

terryma avatar terryma commented on August 23, 2024

Ok, this is briefly mentioned in the Issues section in the README:

Single key commands that do not terminate properly cause unexpected behavior. For example, if the cursor is on the first character in the buffer and 'b' is pressed.

With that said, blank lines should not cause an issue like you described.

Start with cursor on the first line

foo

bar
zip

Vjjj<C-n>l shouldn't cause an issue. Vjjj<C-n>h will cause an issue due to the problem described earlier since the cursor is on f in foo, and pressing h there causes a Vim error. (Turn your terminal bell on and hit h in regular vim's normal mode, it should cause the bell to sound)

To fix this, we need a way to detect that a Vim command terminates successfully. If it doesn't terminate successfully, the function to continue fanning out the user action to all cursor locations is not called, thus causing these 'ghost' cursors to appear.

from vim-multiple-cursors.

terryma avatar terryma commented on August 23, 2024

I just fixed this in the latest release, which brings us to v2.0, finally at a point where I feel like the plugin is stable enough for general usage. Let me know if you still experience this issue. The plugin should inform you now when some input cannot be replayed successfully.

from vim-multiple-cursors.

d11wtq avatar d11wtq commented on August 23, 2024

Oh, nice. Gonna try this now 👍

from vim-multiple-cursors.

d11wtq avatar d11wtq commented on August 23, 2024

That sure does work. Good work. Feels a bit weird deliberately moving the cursors to places they shouldn't be going anyway, but it's not exactly a real use case; it's just good it doesn't break now :)

from vim-multiple-cursors.

terryma avatar terryma commented on August 23, 2024

Yep, the change does fix more annoyance than your particular example. All operator pending commands in normal mode like 'd' and 'c' used to break muticursor mode, now they are treated as unterminated commands and display an error. This paves the way for multikey commands to be implemented in the future.

from vim-multiple-cursors.

d11wtq avatar d11wtq commented on August 23, 2024

Ok, a much more minor issue in relation to this. I can file a separate issue if you want, though this is not really a huge problem at all. If you go past the end of the line, or left of the start of the line, while the plugin doesn't break, it does seem to register a "change" in the undo history.

from vim-multiple-cursors.

terryma avatar terryma commented on August 23, 2024

Could you please open a new issue and describe the steps to repro? I think I know what you mean, it does seem to create a new undo point with no actual change.

from vim-multiple-cursors.

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.