Git Product home page Git Product logo

Comments (8)

chrisgrieser avatar chrisgrieser commented on July 21, 2024 2

thanks, should be fixed

from nvim-spider.

chrisgrieser avatar chrisgrieser commented on July 21, 2024 1

I can't reproduce the issue, it works fine for me. Looking at your screenshot, I suspect you might have virtualedit=onemore turned on. Could you try turning it off?


btw, the %f[] stuff is called the frontier pattern in lua, it's a little bit like \b in js regex, but more flexible: https://www.lua.org/manual/5.4/manual.html#6.4.1

so "%f[^%s]%p" basically means "a whitespace character, followed by a punctuation character, but only include the punctuation character in the match". It's a cool way of emulating regex lookbehinds in lua patterns :)

from nvim-spider.

Aumnescio avatar Aumnescio commented on July 21, 2024

Thanks!

But I'm afraid there is a new issue. I hope the below screenshot illustrates the problem well enough.

image

After reaching the indicated positions, pressing 'W' no longer does anything.
However, moving a single character back will fix the next 'W'.

I suppose there is just some off-by-one error at the end of a line when there is punctuation character.

The 'b' motion seems to be working perfectly.

from nvim-spider.

Aumnescio avatar Aumnescio commented on July 21, 2024

I feel like I fixed it by just removing the '+' from the pattern at line 82:

-- punctAtEnd = "%f[^%s]%p+$",
punctAtEnd = "%f[^%s]%p$",

I don't honestly fully understand the pattern syntax, and I'm not sure if this breaks something unforeseen to me, but it feels like it works very well.

Edit: Nevermind, its not really better. I think I got it to work for a second but now its broken again.

Edit 2:
By removing the '$' from the "punctAtEnd" pattern at least makes the cursor land on the trailing punctuation, but then a lot more punctuation in other places are matched too.

-- punctAtEnd = "%f[^%s]%p+$",
punctAtEnd = "%f[^%s]%p+",

Also, the off-by-one error is happening with leading punctuation too, when the punctuation starts from the first column.

from nvim-spider.

Aumnescio avatar Aumnescio commented on July 21, 2024

I use virtualedit = "all", and you're right, that does affect it. The end of line off-by-one error does not occur with virtualedit disabled.

There is a off-by-one error in leading punctuation though. (With or without virtualedit)

image

Edit: I suspect that disabling virtualedit might just be hiding the bug? As it won't let the cursor go into that position past the line. Would love to be able to continue using virtualedit, too. I've gotten used to it, its comfy and occasionally helpful.

from nvim-spider.

chrisgrieser avatar chrisgrieser commented on July 21, 2024

okay, fixed the off by one from your screenshot.

In regards to virtualedit, could you open a feature request for that? Then I'll try to get to it when I find the time. (The vim docs do mention though that virtualedit might break plugins, since it alters the column count behavior.)

from nvim-spider.

Aumnescio avatar Aumnescio commented on July 21, 2024

Sure.

from nvim-spider.

Aumnescio avatar Aumnescio commented on July 21, 2024

Actually I think you fixed the issue. Even with virtualedit = "all", it seems to work just fine after this commit

from nvim-spider.

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.