diff options
| author | theprimeagain <the.primeagen@gmail.com> | 2026-02-26 07:11:49 -0700 |
|---|---|---|
| committer | theprimeagain <the.primeagen@gmail.com> | 2026-02-26 07:11:49 -0700 |
| commit | cbc24f940f49b28da62642bca10206f3933bec77 (patch) | |
| tree | d9429175bdb3320501358380ff91159a1bb4a30e /lua/99/geo.lua | |
| parent | 9be01a1a50a61635ea7169e01c85fab41638ad66 (diff) | |
| download | a4-cbc24f940f49b28da62642bca10206f3933bec77.tar.xz a4-cbc24f940f49b28da62642bca10206f3933bec77.zip | |
tutorial
Diffstat (limited to 'lua/99/geo.lua')
| -rw-r--r-- | lua/99/geo.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/99/geo.lua b/lua/99/geo.lua index 48e60ad..01c8f71 100644 --- a/lua/99/geo.lua +++ b/lua/99/geo.lua @@ -204,6 +204,14 @@ function Point.from_mark(mark) }, Point) end +--- Returns the line in the editor that this point is on +--- @param buffer number +function Point:line(buffer) + local row, _ = self:to_vim() + local lines = vim.api.nvim_buf_get_lines(buffer, row, row + 1, false) + return lines[1] +end + function Point.zero() return Point.from_0_based(0, 0) end |
