diff options
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 |
