From 6b5b649948732b60b522261e2a6ec14e0f30bb73 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 10 Aug 2011 16:27:55 -0400 Subject: Fixed transpose bug at end of buffer; modules/textadept/editing.lua --- modules/textadept/editing.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index b6b6c9ee..b078d4fb 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -316,9 +316,10 @@ end -- transposed. Otherwise, the characters to the left and right are. function transpose_chars() local buffer = buffer - buffer:begin_undo_action() local pos = buffer.current_pos + if pos == buffer.length then return end local c1, c2 = buffer.char_at[pos - 1], buffer.char_at[pos] + buffer:begin_undo_action() buffer:delete_back() buffer:insert_text((c2 == 10 or c2 == 13) and pos - 2 or pos, string.char(c1)) buffer:end_undo_action() -- cgit v1.2.3