summaryrefslogtreecommitdiff
path: root/lua/99/geo.lua
diff options
context:
space:
mode:
authortheprimeagain <the.primeagen@gmail.com>2026-02-26 07:11:49 -0700
committertheprimeagain <the.primeagen@gmail.com>2026-02-26 07:11:49 -0700
commitcbc24f940f49b28da62642bca10206f3933bec77 (patch)
treed9429175bdb3320501358380ff91159a1bb4a30e /lua/99/geo.lua
parent9be01a1a50a61635ea7169e01c85fab41638ad66 (diff)
downloada4-cbc24f940f49b28da62642bca10206f3933bec77.tar.xz
a4-cbc24f940f49b28da62642bca10206f3933bec77.zip
tutorial
Diffstat (limited to 'lua/99/geo.lua')
-rw-r--r--lua/99/geo.lua8
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