aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-30 11:16:46 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-30 11:16:46 -0400
commita775e9fb4188f2638111c15623ea9bd5c804b3e2 (patch)
treef4df20ceb1b49e3a0ec9226a2ad8a0aae7796ba9 /modules
parent67f1b05766b4138dcbc80ad49fb0043037e07e1e (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua4
1 files changed, 3 insertions, 1 deletions
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)