Comments (8)
thanks, should be fixed
from nvim-spider.
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.
Thanks!
But I'm afraid there is a new issue. I hope the below screenshot illustrates the problem well enough.
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.
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.
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
)
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.
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.
Sure.
from nvim-spider.
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)
- Feature Request: iw and aw HOT 1
- [Bug]: Movement stops at non-English accented letters HOT 5
- Feature Request: Allow option for empty lines to be a significant punctuation (especially for change)
- Feature Request: Allow option for empty lines to be a significant punctuation (especially for change) HOT 1
- [Bug]: Dot repeat is locking up the editor HOT 6
- [deleted] HOT 2
- Feature Request: skipInsignificantPunctuation only in normal mode? HOT 4
- Feature Request: Add W, (g)E and B HOT 2
- Feature Request: c-w (ctrl-w) should work HOT 2
- Feature Request: Word motion on camel case with capitalized acronyms HOT 3
- Feature Request: Add option to use default keymaps HOT 2
- Feature Request: add option to disable subwords HOT 5
- Feature Request: support `wildfire.nvim` HOT 2
- Feature Request: Add instructions for adding keymaps to lazy config HOT 2
- [Bug]: Bugs when camelCase names have numbers in them HOT 1
- [Bug]: Cannot bind to e.g. "<leader>w" HOT 2
- [Bug]: numbers in hex values are not ignored HOT 2
- Feature Request: Support subword delete in insert mode like CTRL-W HOT 1
- Feature Request: Pull in .editorconfig from your template repository HOT 1
- Feature Request/Bug? - Strange behavior on the last word of lines HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-spider.