Skip to content

Instantly share code, notes, and snippets.

@rgieseke
Created June 1, 2010 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgieseke/421382 to your computer and use it in GitHub Desktop.
Save rgieseke/421382 to your computer and use it in GitHub Desktop.
Rectangular selection for Textadept
keys.ar = {function()
local t = _G.textadept
t.statusbar_text = 'Rectangular selection'
t.events.handle('update_ui')
t.events.add_handler('keypress', function(code, shift, control, alt)
local left, up, right, down, esc = 65361, 65362, 65363, 65364, 65307
if alt and code == left then
buffer:char_left_rect_extend()
return true
elseif alt and code == up then
buffer:line_up_rect_extend()
return true
elseif alt and code == right then
buffer:char_right_rect_extend()
return true
elseif alt and code == down then
buffer:line_down_rect_extend()
return true
else
table.remove(textadept.events['keypresss'], 1)
t.statusbar_text = ''
t.events.handle('update_ui')
return
end
end
, 1)
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment