From a775e9fb4188f2638111c15623ea9bd5c804b3e2 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Fri, 30 Apr 2021 11:16:46 -0400 Subject: When filtering through, do not replace buffer contents if nothing changed. This will clear the redo stack, which can be unhelpful when formatting code on save, for example. --- modules/textadept/editing.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 540c5aec..06743709 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -628,7 +628,9 @@ function M.filter_through(command) return end end - buffer:replace_target(output:iconv('UTF-8', _CHARSET)) + output = output:iconv('UTF-8', _CHARSET) + if buffer:get_text() == output then return end -- do not perform no-op + buffer:replace_target(output) view.first_visible_line = top_line if s == e then buffer:goto_pos(s) -- cgit v1.2.3