Code Monkey home page Code Monkey logo

Comments (9)

DCsunset avatar DCsunset commented on June 16, 2024 1

Maybe these two issues are related but I'm not sure now. I'll take a closer look at it after I fix the first problem.

from vscode-modal-editor.

anthonyjclark avatar anthonyjclark commented on June 16, 2024 1

That sounds great!

If you have some time, would you mind trying the latest unpublished version? You may need to clone the repo and package it locally.

I should have some time in the next day or two to give it a try.

from vscode-modal-editor.

DCsunset avatar DCsunset commented on June 16, 2024

Hello,

The reason why other cursors vanish is that currently findText changes only the main selection. To fix it, all the selections should be processed in the same way.
You can attempt the change if you are keen on it. If not, I think I can fix it by the end of next week.

from vscode-modal-editor.

anthonyjclark avatar anthonyjclark commented on June 16, 2024

I'll let you handle it :) but I am happy to contribute if you get bogged down.

On a related note, I noticed that my "move next word start" (and backward) mapping has an odd behavior. It works for all cursors on the first attempt, but then on the second press it too kills the secondary cursors. I am using your example from helix.js, but I turned it into a function. You can see my entire mapping file here if it is useful helixish.js.

cursor-demo.mov

from vscode-modal-editor.

DCsunset avatar DCsunset commented on June 16, 2024

Hi, I think I've fixed findText in the latest commits. Besides, the second issue you mentioned seems to be caused by cancelSelection command, which kills all the secondary cursors if there's any non-empty selection.

So I've added another command called modalEditor.clearSelections that can clear selections but keep all cursors. You can replace the original command with it and it should fix the second issue.

If you have some time, would you mind trying the latest unpublished version? You may need to clone the repo and package it locally.

from vscode-modal-editor.

anthonyjclark avatar anthonyjclark commented on June 16, 2024

I have not thoroughly tested, but everything seems to work aside from one thing: I lose secondary cursors when in selection mode and moving backwards.

This does not happen with moving forward (jumping, moving by word, and moving by character all seem to work).

I also tried using the built-in keybindings (multiple cursors at the end of multiple lines; press shift+option+left), and they seem to work fine. For reference, my back-one-word key is just:

"b": repeatable("cursorWordStartLeftSelect"),

I am not sure why this would result in the behavior I described.

from vscode-modal-editor.

DCsunset avatar DCsunset commented on June 16, 2024

Thanks for your feedback. The reason is that the inclusive selection was not implemented correctly for multiple cursors. I've fixed it in the latest commit.

It would be great if you could verify that it works for you as well.

from vscode-modal-editor.

anthonyjclark avatar anthonyjclark commented on June 16, 2024

I didn't thoroughly test, but everything I tried is working.

Thanks again.

from vscode-modal-editor.

DCsunset avatar DCsunset commented on June 16, 2024

Great! I'll publish a new version and close this issue later.

from vscode-modal-editor.

Related Issues (6)

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.