refactor(nvim): prioritize global marks in statuscol
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled

This commit is contained in:
Price Hiller 2024-04-22 10:07:29 -05:00
parent 6bddbdbb46
commit 27d3bf6b24
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB

View File

@ -42,16 +42,6 @@ return {
text = { text = {
function(args) function(args)
local get_mark = function() local get_mark = function()
local local_mark_buf = vim.iter(vim.fn.getmarklist(args.buf))
:filter(function(mark)
local lnum = mark.pos[2]
return lnum == args.lnum
end)
:next()
if local_mark_buf then
return local_mark_buf.mark:sub(-1)
end
local bufname = vim.api.nvim_buf_get_name(args.buf) local bufname = vim.api.nvim_buf_get_name(args.buf)
local global_mark_buf = vim.iter(vim.fn.getmarklist()) local global_mark_buf = vim.iter(vim.fn.getmarklist())
:filter(function(mark) :filter(function(mark)
@ -65,6 +55,16 @@ return {
return global_mark_buf.mark:sub(-1) return global_mark_buf.mark:sub(-1)
end end
local local_mark_buf = vim.iter(vim.fn.getmarklist(args.buf))
:filter(function(mark)
local lnum = mark.pos[2]
return lnum == args.lnum
end)
:next()
if local_mark_buf then
return local_mark_buf.mark:sub(-1)
end
return " " return " "
end end
local mark = get_mark() local mark = get_mark()