!HCjHPBLFfoFpYNgwdE:matrix.org

Neovim dev

197 Members
Discussion about Neovim development and adjacent topics13 Servers

Load older messages


SenderMessageTime
24 Jul 2024
@clason:matrix.orgclason(there were some breaking changes a few years ago; not looking forward to a repeat of that)14:29:20
@clason:matrix.orgclason
In reply to @fundar:matrix.org
It means Pall is actively annoying
well, mostly it means that we do not need to interact with him, so he can annoy other people
14:29:46
@clason:matrix.orgclason(or be annoyed by other people 🍿)14:31:09
@asn:matrix.orgasn
In reply to @clason:matrix.org
no, that's not true
https://github.com/LuaJIT/LuaJIT-test-cleanup - last commit 8 years ago
14:47:46
@clason:matrix.orgclasonoh, sorry, different repo14:48:05
@clason:matrix.orgclasonthat's another matter of course14:48:22
@clason:matrix.orgclasoncorsix is still active, tho14:48:57
@clason:matrix.orgclason(one of the two people I had in mind above)14:49:08
@asn:matrix.orgasnneovim 0.10.1 update for f40: https://bodhi.fedoraproject.org/updates/FEDORA-2024-1b0f0b9cdc14:56:41
@gpanders:matrix.orggpandersdo we have a way to convert a byte offset into a (row, col) position? I feel like we must have that somewhere for all of the conversion that we do in tree-sitter and LSP, but nothing is immediately springing to mind17:59:26
@gpanders:matrix.orggpanders* do we have a way to convert a byte offset in a buffer into a (row, col) position? I feel like we must have that somewhere for all of the conversion that we do in tree-sitter and LSP, but nothing is immediately springing to mind17:59:31
@gpanders:matrix.orggpandersor even more directly, given a (start, end) byte range, how do I best set an extmark over that range18:00:51
@echasnovski:matrix.orgechasnovski
In reply to @gpanders:matrix.org
do we have a way to convert a byte offset in a buffer into a (row, col) position? I feel like we must have that somewhere for all of the conversion that we do in tree-sitter and LSP, but nothing is immediately springing to mind
There is :h byte2line().
18:04:44
@mfussenegger:matrix.orgMathias
In reply to @gpanders:matrix.org
do we have a way to convert a byte offset in a buffer into a (row, col) position? I feel like we must have that somewhere for all of the conversion that we do in tree-sitter and LSP, but nothing is immediately springing to mind
https://github.com/mfussenegger/nvim-jdtls/blob/6bfd1591583b02e742fc3a2f43393c4ea3b6d3c7/lua/jdtls.lua#L673
18:09:11
@gpanders:matrix.orggpanders
In reply to@echasnovski:matrix.org
There is :h byte2line().
yea that gives you the line, but then how would you determine the column from that? Since that doesn't tell you how many bytes are "consumed" in order to get to that line
18:11:51
@mfussenegger:matrix.orgMathiasyou get the column by subtracting line2byte(lnum) from the byteidx. See my linked example18:19:31
@gpanders:matrix.orggpandersah yea that makes sense18:23:57
@gpanders:matrix.orggpandersthanks18:23:58
@echasnovski:matrix.orgechasnovskiI'd also be careful with what kind of byte offset it is. I.e. whether it accounts for end of line characters or not.18:27:20
@gpanders:matrix.orggpanders it's whatever regex:match_line gives me 18:49:30
@gpanders:matrix.orggpanders I made a plugin that adds the url extmark to any URL in any buffer, it ended up being a lot simpler than I expected https://paste.sr.ht/~gpanders/db761bc19e77677962bcafd465b21c1094a0bc68 18:53:04
@gpanders:matrix.orggpandersI'm also not sure what the performance implications are of doing a regex match on every line redraw 🙈18:53:51
@echasnovski:matrix.orgechasnovski
In reply to @gpanders:matrix.org
I made a plugin that adds the url extmark to any URL in any buffer, it ended up being a lot simpler than I expected https://paste.sr.ht/~gpanders/db761bc19e77677962bcafd465b21c1094a0bc68
Nice! Any reason to not use plain string.match() only on actually changed lines?
And clearing namespace (like on line change) is usually a good idea.
19:29:46
@echasnovski:matrix.orgechasnovski
In reply to @gpanders:matrix.org
I made a plugin that adds the url extmark to any URL in any buffer, it ended up being a lot simpler than I expected https://paste.sr.ht/~gpanders/db761bc19e77677962bcafd465b21c1094a0bc68
* Nice! Any reason to not use plain string.find() only on actually changed lines?
And clearing namespace (like on line change) is usually a good idea.
19:30:37
@gpanders:matrix.orggpandersI don’t need to clear the namespace since these are ephemeral extmarks19:46:21
@gpanders:matrix.orggpandersAnd the decoration provider is only running on changed lines AFAIK (though I’m not 100% sure about that19:46:58
@gpanders:matrix.orggpanders * 19:47:05
@bfredl:matrix.orgbfredltechnically, on redrawn lines (which typically is changed lines plus surroundings due to syntax hl changes)19:48:45
25 Jul 2024
@echasnovski:matrix.orgechasnovski
In reply to @gpanders:matrix.org
I don’t need to clear the namespace since these are ephemeral extmarks
True. Was sleepy and missed that.
05:36:32
@echasnovski:matrix.orgechasnovski
In reply to @gpanders:matrix.org
And the decoration provider is only running on changed lines AFAIK (though I’m not 100% sure about that)
Fennel messed up my parsing of what is going on. I thought it searches whole buffer for Vim regex on every line change. But (regex:match_line bufnr row) does not do that, but indeed is more precise. Again, was sleepy.
05:38:49

There are no newer messages yet.


Back to Room ListRoom Version: 10