aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-02-22 14:49:05 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-02-22 14:49:05 -0500
commit7447ac1229e4aab7e1ee4f95d321277640f0ee92 (patch)
tree33b88155098db472b36e9215e9a2c9c2f2a19d07
parentb3c8aac95d0048b2acb54e28194987fc63a6f0ee (diff)
downloadtextadept-7447ac1229e4aab7e1ee4f95d321277640f0ee92.tar.gz
textadept-7447ac1229e4aab7e1ee4f95d321277640f0ee92.zip
Set MARK_*_COLOR for all new views rather than just the current one.
-rw-r--r--modules/textadept/bookmarks.lua5
-rw-r--r--modules/textadept/mlines.lua5
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index 78f95b13..fa890ec2 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -19,7 +19,6 @@ local MARK_BOOKMARK_COLOR = 0xC08040
-- Adds a bookmark to the current line.
function add()
local buffer = buffer
- buffer:marker_set_back(MARK_BOOKMARK, MARK_BOOKMARK_COLOR)
local line = buffer:line_from_position(buffer.current_pos)
buffer:marker_add(line, MARK_BOOKMARK)
end
@@ -70,3 +69,7 @@ function goto_prev()
end
if line >= 0 then _m.textadept.editing.goto_line(line + 1) end
end
+
+buffer:marker_set_back(MARK_BOOKMARK, MARK_BOOKMARK_COLOR)
+textadept.events.add_handler('view_new',
+ function() buffer:marker_set_back(MARK_BOOKMARK, MARK_BOOKMARK_COLOR) end)
diff --git a/modules/textadept/mlines.lua b/modules/textadept/mlines.lua
index 2cd1cb93..ab83172c 100644
--- a/modules/textadept/mlines.lua
+++ b/modules/textadept/mlines.lua
@@ -29,7 +29,6 @@ local mlines_most_recent
-- column position of the caret in the mlines table.
function add()
local buffer = buffer
- buffer:marker_set_back(MARK_MLINE, MARK_MLINE_COLOR)
local column = buffer.column[buffer.current_pos]
local line = buffer:line_from_position(buffer.current_pos)
local new_marker = buffer:marker_add(line, MARK_MLINE)
@@ -137,3 +136,7 @@ function update()
end
buffer:end_undo_action()
end
+
+buffer:marker_set_back(MARK_MLINE, MARK_MLINE_COLOR)
+textadept.events.add_handler('view_new',
+ function() buffer:marker_set_back(MARK_MLINE, MARK_MLINE_COLOR) end)