I think it could be useful to have a help page covering indexing into strings/buffers/windows/the screen. Specifically I think this would be useful for plugin authors writing text manipulation code where alignment is important, for example when writing an in-buffer GUI or writing a plugin dealing with text alignment.
My hope is that this page can cover the main coordinate systems in Vim (buffer, window, virtual, screen), functions that let you get/set text and cursor position in each of these coordinate systems, and conversion between the coordinate systems. It is also a good place to talk about the different "coordinate systems" for indexing into a string (byte/character/display column).
Doing this will take a lot of work, so before I go further I would like to get feedback:
indexing.txt, geometry.txt, coords.txt, coordinates.txt, ...
indexing.txt is a good name, but it's very close to index.txt, which might be annoying.builtin.txt, or should the reference documentation for all of these functions get moved to this help page?The PR below has a proposed outline and a writing sample. Let me know what you think and whether I should continue.
Thanks!
https://github.com/vim/vim/pull/10405
(3 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
That sounds like a great plan. One of Vim's strengths is its plugin community, and a section in the manual about extending/scripting Vim sounds very useful.
It sounds like a good next step is to split a bunch of usr_41.txt into usr_5X.txt pages, under an "Extending Vim" or "Scripting Vim" section of the user manual. Bram, is this something you would like to do personally, or do you think it would be productive for me to give it a shot? Once that is done, the content I am writing can be added incrementally.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Closed #10405.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()