aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/editing.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-07-12 12:49:30 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2009-07-12 12:49:30 -0400
commit070f12d6eef343179335d12686c24f8055c2514d (patch)
treebe54f4c787825ed85788cddd50fdb4c43966d7d1 /modules/textadept/editing.lua
parent741ce69b41705b7ad048283e6893ebcb693326fc (diff)
downloadtextadept-070f12d6eef343179335d12686c24f8055c2514d.tar.gz
textadept-070f12d6eef343179335d12686c24f8055c2514d.zip
Lua code cleanup.
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r--modules/textadept/editing.lua18
1 files changed, 7 insertions, 11 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 249952e4..c832c8fe 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -363,8 +363,7 @@ function smart_paste(action, reindent)
if txt then
if reindent then
local indent =
- buffer.line_indentation[
- buffer:line_from_position(buffer.current_pos)]
+ buffer.line_indentation[buffer:line_from_position(buffer.current_pos)]
local padding =
string.rep(buffer.use_tabs and '\t' or ' ',
buffer.use_tabs and indent / buffer.tab_width or indent)
@@ -482,19 +481,16 @@ end
---
-- Selects text in a specified enclosure.
--- @param str The enclosure type in enclosure. If str is not specified,
--- matching character pairs defined in char_matches are searched for from the
--- caret outwards.
+-- @param str The enclosure type in enclosure.
-- @see enclosure
-- @see char_matches
function select_enclosed(str)
+ if not str then return end
local buffer = buffer
- if str then
- buffer:search_anchor()
- local s = buffer:search_prev(0, enclosure[str].left)
- local e = buffer:search_next(0, enclosure[str].right)
- if s and e then buffer:set_sel(s + 1, e) end
- end
+ buffer:search_anchor()
+ local s = buffer:search_prev(0, enclosure[str].left)
+ local e = buffer:search_next(0, enclosure[str].right)
+ if s and e then buffer:set_sel(s + 1, e) end
end
---