aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/editing.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-09-16 20:49:23 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-09-16 20:49:23 -0400
commitdbef5c3fa8ca9f842f75a6db1f0aa0fb029a4be6 (patch)
treec215e7a3ae04be1343820a2577543f8154c28580 /modules/textadept/editing.lua
parent9ccea9e562699b45ba830b8b1355571061580386 (diff)
downloadtextadept-dbef5c3fa8ca9f842f75a6db1f0aa0fb029a4be6.tar.gz
textadept-dbef5c3fa8ca9f842f75a6db1f0aa0fb029a4be6.zip
Moved custom markers and indicators into themes and added more properties.
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r--modules/textadept/editing.lua16
1 files changed, 3 insertions, 13 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 143d07f5..8f6d93a2 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -167,10 +167,7 @@ events.connect(events.FILE_BEFORE_SAVE, function()
local s, e = buffer:position_from_line(line), line_end_position[line]
local i, c = e - 1, char_at[e - 1]
while i >= s and c == 9 or c == 32 do i, c = i - 1, char_at[i - 1] end
- if i < e - 1 then
- buffer.target_start, buffer.target_end = i + 1, e
- buffer:replace_target('')
- end
+ if i < e - 1 then buffer:delete_range(i + 1, e - i - 1) end
end
-- Ensure ending newline.
local e = buffer:position_from_line(lines)
@@ -309,7 +306,8 @@ function M.block_comment(comment)
end
---
--- Goes to line number *line* or the user-specified line in the buffer.
+-- Moves the caret to the beginning of line number *line* or the user-specified
+-- line, ensuring the line is visible.
-- @param line Optional line number to go to. If `nil`, the user is prompted for
-- one.
-- @name goto_line
@@ -501,14 +499,6 @@ function M.highlight_word()
buffer:set_sel(s, e)
end
--- Sets view properties for highlighted word indicators and markers.
-events.connect(events.VIEW_NEW, function()
- buffer.indic_fore[M.INDIC_HIGHLIGHT] = not CURSES and 0x4D99E6 or 0x008080
- buffer.indic_style[M.INDIC_HIGHLIGHT] = buffer.INDIC_ROUNDBOX
- buffer.indic_alpha[M.INDIC_HIGHLIGHT] = 255
- if not CURSES then buffer.indic_under[M.INDIC_HIGHLIGHT] = true end
-end)
-
---
-- Passes selected or all buffer text to string shell command *command* as
-- standard input (stdin) and replaces the input text with the command's