Code Monkey home page Code Monkey logo

Comments (3)

wellle avatar wellle commented on May 22, 2024

Oh thank you. I will wrap these undotree calls in some checks to avoid that. You won't get the undo of operations on missing targets though.

from targets.vim.

jsit avatar jsit commented on May 22, 2024

Why would I want to undo something that didn't change anything?

On Tue, Feb 11, 2014 at 11:11 AM, Christian Wellenbrock <
[email protected]> wrote:

Oh thank you. I will wrap these undotree calls in some checks to avoid
that. You won't get the undo of operations on missing targets though.

Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-34769809
.

from targets.vim.

wellle avatar wellle commented on May 22, 2024

Unfortunately I'm not aware of any way to cancel an operation from within an operation-pending mapping. So when I don't find the target, the operation still occurs, even though it doesn't change anything. In order to address your previously reported issue #4 I decided to undo that operation that didn't change anything to behave as if the operation didn't happen at all.

I use undotree() to see whether or not something changed in between, by comparing the seq_cur index with its previous value. Only if it changed I undo the last operation. If you are aware of a better approach I would be happy to implement it.

from targets.vim.

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.