From 27aeb2e715c32cbb99aa0b326b31739464b61644 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Thu, 26 May 2022 12:55:53 +0100 Subject: [PATCH] fix(blame): don't lag on folded lines --- lua/gitsigns/current_line_blame.lua | 5 +++++ teal/gitsigns/current_line_blame.tl | 5 +++++ types/types.d.tl | 1 + 3 files changed, 11 insertions(+) diff --git a/lua/gitsigns/current_line_blame.lua b/lua/gitsigns/current_line_blame.lua index e1e15f0..1fd1df3 100644 --- a/lua/gitsigns/current_line_blame.lua +++ b/lua/gitsigns/current_line_blame.lua @@ -110,6 +110,11 @@ local update = void(function() set_extmark(bufnr, lnum) end + + if vim.fn.foldclosed(lnum) ~= -1 then + return + end + local opts = config.current_line_blame_opts diff --git a/teal/gitsigns/current_line_blame.tl b/teal/gitsigns/current_line_blame.tl index 4ad41ab..748b4b2 100644 --- a/teal/gitsigns/current_line_blame.tl +++ b/teal/gitsigns/current_line_blame.tl @@ -110,6 +110,11 @@ local update = void(function() set_extmark(bufnr, lnum) end + -- Can't show extmarks on folded lines so skip + if vim.fn.foldclosed(lnum) ~= -1 then + return + end + local opts = config.current_line_blame_opts -- Note because the same timer is re-used, this call has a debouncing effect. diff --git a/types/types.d.tl b/types/types.d.tl index c789fa2..2586b75 100644 --- a/types/types.d.tl +++ b/types/types.d.tl @@ -222,6 +222,7 @@ global record vim getpos: function(string): {integer} executable: function(string): integer expand: function(string): string + foldclosed: function(integer): integer getcwd: function(): string input: function(string, string): string