(chore) run formatter
All checks were successful
NeoVim tests / plenary-tests (push) Successful in 11s

This commit is contained in:
2025-04-27 15:55:28 -06:00
parent 5a6451a85e
commit 0e7b741b38
5 changed files with 88 additions and 31 deletions

View File

@@ -46,7 +46,11 @@ function Pos.invalid() return Pos.new(0, 0, 0, 0) end
function Pos.__lt(a, b) return a.lnum < b.lnum or (a.lnum == b.lnum and a.col < b.col) end
function Pos.__le(a, b) return a < b or a == b end
function Pos.__eq(a, b)
return getmetatable(a) == Pos and getmetatable(b) == Pos and a.bufnr == b.bufnr and a.lnum == b.lnum and a.col == b.col
return getmetatable(a) == Pos
and getmetatable(b) == Pos
and a.bufnr == b.bufnr
and a.lnum == b.lnum
and a.col == b.col
end
function Pos.__add(x, y)
if type(x) == 'number' then

View File

@@ -3,7 +3,7 @@ local Pos = require 'u.pos'
-- Certain functions in the Range class yank text. In order to prevent unwanted
-- highlighting, we intercept and discard some calls to the `on_yank` callback.
local orig_on_yank = (vim.hl or vim.highlight).on_yank
local on_yank_enabled = true;
local on_yank_enabled = true
((vim.hl or vim.highlight) --[[@as any]]).on_yank = function(opts)
if not on_yank_enabled then return end
return orig_on_yank(opts)