Coder Social home page Coder Social logo

Comments (13)

 avatar commented on September 6, 2024

For anyone wanting to follow along at home, I have a fix available on cw-special-case at https://gitlab.com/crussell/amVim.git

from amvim-for-vscode.

 avatar commented on September 6, 2024

Why are you taking fixes but changing the committer ID to your name, and assigning bugs that already have fixes to yourself instead of either accepting the existing fix or discussing the changes?

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

@ghost
Sorry, I don't know how to merge commits from outside github, so I just copied them by hand.

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

About the assignment, I used it to identify that I might need to check the issue sooner.
This is misleading and I removed all those assignments.

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

I just realized I could add a new origin and merge branch from it!
I'll do this next time.

from amvim-for-vscode.

 avatar commented on September 6, 2024

This is ready to merge with 0.1.1 now. git pull https://gitlab.com/crussell/amVim.git cw-special-case

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

Please give me some time to check this one.

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

I'm not sure about passing actions' args to motions.
It can make the input -> action -> motion flow harder to control and understand.

How about passing isChange: boolean to ActionDelete.byMotions and then deal with it like isInclusive?

from amvim-for-vscode.

 avatar commented on September 6, 2024

The problem is we need to be able to select the correct behavior for w at some point before it gets added to the motions array. By the time we get to ActionDelete.byMotions, we've already created the motion, which means it can only follow the normal semantics for w (i.e., NEXT_START).

Whatever fix we take for this is probably not going to be very clean. It's a special case where Vim itself, intervenes to rewrite the rules about what w is supposed to mean.

If you don't want all the args getting merged, what about allowing commands to pass an optional set of args forward to the motion? We would be able to select the appropriate semantics that way. It would work the same as my current change does, except it would happen through an extra sidechannel, instead of creating a single set of coalesced args. Bindings that never use the sidechannel wouldn't be affected. This actually does end up sounding pretty clean to me.

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

The option param of motions' apply function is intended for special case like this.
I think we don't need to implement another way to deal with special cases unless it is impossible with the current one. (And if that is the case, we should eliminate the option param and change it to the new way.)

https://github.com/aioutecism/amVim-for-VSCode/blob/master/src/Motions/Motion.ts#L15

from amvim-for-vscode.

 avatar commented on September 6, 2024

Okay, I used option instead.

https://gitlab.com/crussell/amVim/commit/9672a0adbbb91dee91af910d8beff999c2506563

I'm not calling it isChange anymore. I was writing some code comments to clarify that it wasn't for general purpose use and there shouldn't really be any other reason to use it, but then I just named it cwNeedsFixup instead. It's more self-documenting that way, and I can leave out the comments.

Note that this is a different branch (cw-new). I branched off the old cw-special-case to avoid committing changes that would have just reverted what was in the other commit.

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

Thanks for the fix.
Merged d7c0494.

from amvim-for-vscode.

aioutecism avatar aioutecism commented on September 6, 2024

Also, I'm thinking using getWordRangeAtPosition from VSCode's API to do word motion.
Maybe next time.

from amvim-for-vscode.

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.