Giter VIP home page Giter VIP logo

Comments (6)

keforbes avatar keforbes commented on June 1, 2024

This is a configurable option called 'moveonyank', it is enabled by default. See this page for details:
http://vrapper.sourceforge.net/documentation/?page=6

There has been some discussion on whether to change the default so it doesn't move the cursor on yank. I don't feel strongly about it so we may change the default in the future. I'll ask the other developers.

from vrapper.

goj avatar goj commented on June 1, 2024

It is about Vim's inconsistency that I have just noticed reading this bug report. Vim doesn't move the cursor when you do line-based yank (like yy), but it does move to beginning of yanked range when you yank text (eg. yb), in particular text objects (yib). I wasn't aware of that when adding moving to beginning of yanked text and creating moveonyank option. As a result moveonyank is all-or-nothing, so it's impossible to recreate Vim's behaviour in current Vrapper.

This bug report is completely legit, so I'm re-opening it.

Bug-for-bug compatibility is hard but I think we should aim at it, especially with basic things as yanking the current line.

from vrapper.

keforbes avatar keforbes commented on June 1, 2024

After playing with vim a bit, it looks like the cursor always moves to the beginning of the selection.... except with 'yy'. If the cursor is already at the start of the selection (yw, y$, vkky, ytx, yG) it doesn't move. If the cursor is not at the start of the selection (yib, y0, vjjy, Vy, yib, yTx, ygg) the cursor jumps to the start of the selection. As far as I can tell, 'yy' is the only exception to this rule. It's actually weird that Vy moves the cursor and yy does not. Aside from the highlight, they're equivalent operations.

Good luck goj! I think I'll let you take this one. :-)

from vrapper.

goj avatar goj commented on June 1, 2024

@keforbes: it's even worse

yj moves one line below (so it moves, but not to the border of selection). There are more exceptions, but I couldn't find any rule that could explain it. Try: y}, y{, yVh, 2yVh. It's quite random :-/

Maybe we could special-case yy with an option, the same way we do dw - stupid Vim's inconsistency, but something people are used to.

I don't feel I have enough free time to code this :-/

from vrapper.

keforbes avatar keforbes commented on June 1, 2024

It seems to me that we would want to always move on yank unless we're in LINES mode. I say throw away the :moveonyank property and just use that logic.

from vrapper.

keforbes avatar keforbes commented on June 1, 2024

I have submitted a Pull Request which I think covers most of these cases. Please test out the code at:
#32

from vrapper.

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.