Giter Club home page Giter Club logo

Comments (4)

totalgee avatar totalgee commented on June 14, 2024

A few more (single-line) test cases that currently fail:

// More `%` test cases
CURSOR_TEST(motion_percent_multiple, "vec2(cos(x), sin(y))", "9l%", 8, 0); // fail: jumps to 18
CURSOR_TEST(motion_percent_multiple, "vec2(cos(x), sin(y))", "10l%", 8, 0); // should be same as previous (starting on paren) - fail: jumps to 18
CURSOR_TEST(motion_percent_multiple, "vec2(cos(x), sin(y))", "9l%%", 10, 0); // fail: jumps to 16
CURSOR_TEST(motion_percent_multiple, "vec2(cos(x), sin(y))", "17l%", 16, 0); // fail: jumps back to 8
CURSOR_TEST(motion_percent_multiple, "vec2(cos(x), sin(y))", "17l%%", 18, 0); // fail: jumps to 10

from zep.

cmaughan avatar cmaughan commented on June 14, 2024

Thanks for the report; I made this more complicated than it needed to be :) I've added the new unit tests and everything passes. Regarding your comment "Zep does not find matching parens when they're on a previous line (unlike Vim)." I think you may have been referring to the character on a final bracket matching a previous one on a different line:

{
} -< Matches to above

This seems to work too; but note that Zep will not search forward beyond the current line to find the bracket to start on. This matches neovim and VsVim as far as I can see.

from zep.

totalgee avatar totalgee commented on June 14, 2024

Yes, that's what I meant, and what you've done seems correct (especially if all those tests now pass...I've not tried it yet but it sounds good). Yes, it's not supposed to search forward beyond the current line to find a bracket to start on, according to the Vim "spec":

Find the next item in this line after or under the cursor and jump to its match. (from :help %)

The matched item may be on a different line (earlier or later), but the starting item should only be after the cursor, and only considering the current line.

Thanks again for this!

from zep.

totalgee avatar totalgee commented on June 14, 2024

Tested it out with the latest version and all seems great with %, thanks.

from zep.

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.