aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/bookmarks.lua7
-rw-r--r--modules/textadept/editing.lua16
-rw-r--r--modules/textadept/run.lua7
3 files changed, 3 insertions, 27 deletions
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index b6fc39d5..c70983a1 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -66,11 +66,4 @@ function M.goto_mark(next)
end
end
-local CURSES_MARK = buffer.SC_MARK_CHARACTER + string.byte(' ')
--- Sets view properties for bookmark markers.
-events.connect(events.VIEW_NEW, function()
- if CURSES then buffer:marker_define(M.MARK_BOOKMARK, CURSES_MARK) end
- buffer.marker_back[M.MARK_BOOKMARK] = not CURSES and 0xB3661A or 0x800000
-end)
-
return M
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
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 87e292c4..fd3be697 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -241,11 +241,4 @@ events.connect(events.DOUBLE_CLICK, function(pos, line)
if is_msg_buf(buffer) then M.goto_error(line) end
end)
-local CURSES_MARK = buffer.SC_MARK_CHARACTER + string.byte(' ')
--- Sets view properties for error markers.
-events.connect(events.VIEW_NEW, function()
- if CURSES then buffer:marker_define(M.MARK_ERROR, CURSES_MARK) end
- buffer.marker_back[M.MARK_ERROR] = not CURSES and 0x8080CC or 0x000080
-end)
-
return M