Sender | Message | Time |
---|---|---|
24 Jul 2024 | ||
clason | (there were some breaking changes a few years ago; not looking forward to a repeat of that) | 14:29:20 |
clason | In reply to @fundar:matrix.orgwell, mostly it means that we do not need to interact with him, so he can annoy other people | 14:29:46 |
clason | (or be annoyed by other people 🍿) | 14:31:09 |
asn | In reply to @clason:matrix.orghttps://github.com/LuaJIT/LuaJIT-test-cleanup - last commit 8 years ago | 14:47:46 |
clason | oh, sorry, different repo | 14:48:05 |
clason | that's another matter of course | 14:48:22 |
clason | corsix is still active, tho | 14:48:57 |
clason | (one of the two people I had in mind above) | 14:49:08 |
asn | neovim 0.10.1 update for f40: https://bodhi.fedoraproject.org/updates/FEDORA-2024-1b0f0b9cdc | 14:56:41 |
gpanders | do 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 mind | 17:59:26 |
gpanders | * 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 | 17:59:31 |
gpanders | or even more directly, given a (start, end) byte range, how do I best set an extmark over that range | 18:00:51 |
echasnovski | In reply to @gpanders:matrix.orgThere is :h byte2line() . | 18:04:44 |
Mathias | In reply to @gpanders:matrix.orghttps://github.com/mfussenegger/nvim-jdtls/blob/6bfd1591583b02e742fc3a2f43393c4ea3b6d3c7/lua/jdtls.lua#L673 | 18:09:11 |
gpanders | In reply to@echasnovski:matrix.orgyea 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 |
Mathias | you get the column by subtracting line2byte(lnum) from the byteidx. See my linked example | 18:19:31 |
gpanders | ah yea that makes sense | 18:23:57 |
gpanders | thanks | 18:23:58 |
echasnovski | I'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 | it's whatever regex:match_line gives me | 18:49:30 |
gpanders | 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 | I'm also not sure what the performance implications are of doing a regex match on every line redraw 🙈 | 18:53:51 |
echasnovski | In reply to @gpanders:matrix.orgNice! 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 | In reply to @gpanders:matrix.org* 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 | I don’t need to clear the namespace since these are ephemeral extmarks | 19:46:21 |
gpanders | And the decoration provider is only running on changed lines AFAIK (though I’m not 100% sure about that | 19:46:58 |
gpanders | * | 19:47:05 |
bfredl | technically, on redrawn lines (which typically is changed lines plus surroundings due to syntax hl changes) | 19:48:45 |
25 Jul 2024 | ||
echasnovski | In reply to @gpanders:matrix.orgTrue. Was sleepy and missed that. | 05:36:32 |
echasnovski | In reply to @gpanders:matrix.orgFennel 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 |