Comments (5)
Looking at this part of the code tells me nvim-spider relies on regular Lua string patterns such as %u
for uppercase letters.
To my knowledge, the reason accented letters are ignored in such patterns is because Neovim relies on LuaJIT, which is based on Lua 5.1, which doesn't support the UTF8 character set (unlike later versions of Lua).
One option could be to rewrite that part of the code in order to use the external library utf8, and distribute the library with the plugin. I'm not very familiar with plugin development at this point, so I'm not sure if this would be the 'right' way of doing it though.
from nvim-spider.
good find. yeah, I assume that adding some library like that would be necessary. however, I am a bit short on time for the next couple of weeks, so feel free to submit a PR if you figure it out?
from nvim-spider.
Hello and welcome!
I tried to make it, found some libraries that do it, but need to understand some things. First, I found the useful C library in github, which can be compiled by luarocks: starwing/luautf8
.
But, as you know, it's not simple to add non-plugin for neovim lua library. That's make some complexity to install but I also find these things:
- packer.nvim already have some functionality that installs non-plugin for neovim lua library (keyword
use_rocks
); - if user don't use the packer.nvim then he can install plugin
theHamsta/nvim_rocks
that also do.
In the second case, need put some code in dependencies. For example, in lazy.nvim:
return {
"chrisgrieser/nvim-spider",
dependencies = {
"starwing/luautf8",
{
"theHamsta/nvim_rocks",
event = "VeryLazy",
build = "pip3 install --user hererocks && python3 -mhererocks . -j2.1.0-beta3 -r3.0.0 && cp nvim_rocks.lua lua",
config = function()
local rocks = require("nvim_rocks")
rocks.ensure_installed("luautf8")
end,
},
},
}
Finally, I've writed code for me and I've found nuances. col
indexing will be deprecated in the method getNextPosition
and firstMatchAfter
because UTF-8 contains bytes that have different widths and need use offset
instead of this. As you see, need rewrite some code. I don't know how you feel about this, so I'd like to know what you think about it, @chrisgrieser?
from nvim-spider.
I've reimplemented the plugin and fixed the issue as well. neowords.nvim
from nvim-spider.
added in the latest release, see readme for adding the required luarocks dependency for it
from nvim-spider.
Related Issues (20)
- Feature Request: iw and aw HOT 1
- 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.