You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"body": "I don't know if it's related to __go-client__ or __neovim__, so I'm sorry if it's off-topic.\n\nI'm trying to add support for proportional fonts to [goneovim](https://github.com/akiyosi/goneovim), and I feel like it would be great if the GUI client could have a direct access to the function [win_col_off](https://github.com/neovim/neovim/blob/master/src/nvim/move.c#L770), which returns the actual width of the gutter containing sign columns and line numbers.\nAs now, goneovim uses the highlights groups names of the cells to identify when the gutter stops, but having this information directly would make easier to draw separately the gutter and the buffer.\nFor proportional fonts, it would make easier to align the content of the buffer.\n\n(It's related to #17229, but I think that having to call the `getwininfo` function to get its `textoff` fields is a bit complicated, when a direct call to `win_col_off` using the window id could be easily added..?)",
7
+
"closed_at": null,
8
+
"closed_by": null,
9
+
"comment_data": [
10
+
{
11
+
"author_association": "MEMBER",
12
+
"body": "> having to call the `getwininfo` function to get its `textoff` fields is a bit complicated, when a direct call to `win_col_off` using the window id could be easily added..?)\n\n? show code examples",
"body": "@justinmk \nFirst of all, I'm sorry if it's just me having not understood something, which I believe is the case. I've read many times the UI page and some of the source code of other GUIs but I'm sure I haven't understand all the thing. Sorry, I probably should have waited and studied/tried more before posting (twice). Plus, I have no real formation in programming (but I don't use AI, I really learn), that's why I try so much to add support for proportional fonts.\n\nI thought that API function were more available for GUI than other functions, e.g. using Go-Client, because they are defined in `api_def.go` and then generated to `api.go`, while other functions aren't. So I thought there was an advantage for the GUI to use the Go method `Nvim.WindowPosition(...)`, instead of calling Vimscript functions. I did wish there was a similar way to get the buffer offset, since it's required to draw the buffer content when using a proportional font (thus its required frequently), or when drawing the sign/numbercolumn separately than the buffer content (which Goneovim does in some cases). The fact that no GUI seems to call `getwininfo` made me believe that is was uncallable in an easy and performant way (maybe they just don't need it).\n\nThat's why on the [PR](https://github.com/neovim/neovim/pull/13931) you commented too, I said it would be great to have the textoff as an API function: I understood how to add an API function in Go-Client, and how it's easily callable. What I did think was something like:\n\n```go\nwinColOff, err := nvim.WindowColOff(window)\n\n// similar to:\npos, err := nvim.WindowPosition(window)\nwinConfig, err := nvim.WindowConfig(window)\n```\n\nI get the `getwininfo` output this way (I have to admit it's not really \"complicated\"): \n\n ```go\nvar output interface{}\nerr := nvim.Call(\"getwininfo\", &output, window)\nif err != nil {\n // ...\n}\n\n// I could probably also do:\nerr := vim.ExecLua(\"return vim.fn.getwininfo(...)\", &output, window)\n// ...\n```\n\nWhat I need is in the result, but after some times it leads to lags and eventually to non-responding state: I thought it was because I call it too often (but cannot call it less, since the offset can change all the time). But now, I think I've actually identified the issue I was encountering. So if you think that this is not desirable/useful to add such an API function, I think the issue can be closed. Sorry again (also for my english).\n",
0 commit comments