aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-06-20 12:34:26 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-06-20 12:34:26 -0400
commit7c635fc026fde1ecf63274043624cdc8697a0691 (patch)
tree856fea30d40df794abf2b2c8c07ec18f18786117 /modules
parenta1176cf6de333e70100c2c61ceabf73bece36721 (diff)
downloadtextadept-7c635fc026fde1ecf63274043624cdc8697a0691.tar.gz
textadept-7c635fc026fde1ecf63274043624cdc8697a0691.zip
More code cleanup; modules/textadept/editing.lua
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 4533d43c..31bbbaa5 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -419,16 +419,15 @@ function M.convert_indentation()
buffer:begin_undo_action()
for line = 0, buffer.line_count do
local s = buffer:position_from_line(line)
- local indent = line_indentation[line]
- local indent_pos = line_indent_position[line]
- current_indentation = buffer:text_range(s, indent_pos)
+ local indent, e = line_indentation[line], line_indent_position[line]
+ current_indentation = buffer:text_range(s, e)
if buffer.use_tabs then
new_indentation = ('\t'):rep(indent / buffer.tab_width)
else
new_indentation = (' '):rep(indent)
end
if current_indentation ~= new_indentation then
- buffer.target_start, buffer.target_end = s, indent_pos
+ buffer.target_start, buffer.target_end = s, e
buffer:replace_target(new_indentation)
end
end