Skip to content

Commit

Permalink
fix(splitview): Fixed a bug causing splitview buffers content to not …
Browse files Browse the repository at this point in the history
…update.

Ref: #177
  • Loading branch information
OXY2DEV committed Jan 10, 2025
1 parent 43f3cc9 commit 4cf1dad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugin/markview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ vim.api.nvim_create_autocmd({
callback = function (event)
---+${lua}
timer:stop();

local buffer = event.buf;
local name = event.event;
local mode = vim.api.nvim_get_mode().mode;
Expand Down Expand Up @@ -218,6 +219,7 @@ vim.api.nvim_create_autocmd({
local lines = vim.api.nvim_buf_line_count(buffer);

if lines >= max_l then
--- Partial render is used.
if immediate_render() == true then
markview.splitview_render(true, true);
elseif vim.list_contains({ "CursorMoved", "CursorMovedI" }, name) then
Expand All @@ -231,9 +233,14 @@ vim.api.nvim_create_autocmd({
markview.splitview_render(true, true);
end));
end
--- Partial render is used.
else
markview.update_splitview_cursor();
local edit_events = { "TextChanged", "TextChangedI" };

if vim.list_contains(edit_events, name) then
markview.splitview_render(true, true);
else
markview.update_splitview_cursor();
end
end
else
--- Normal renderer.
Expand Down

0 comments on commit 4cf1dad

Please sign in to comment.