aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/editing.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-09-08 23:12:38 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-09-08 23:12:38 -0400
commit393e320d1f8170ff76fb18fca34b5dbdf36dd31f (patch)
tree1a53dd4e4a7613d1c020dcb23eeb369772b22e2c /modules/textadept/editing.lua
parent80320c9dfa0840dc3ce9ea49517722b0380e3cfa (diff)
downloadtextadept-393e320d1f8170ff76fb18fca34b5dbdf36dd31f.tar.gz
textadept-393e320d1f8170ff76fb18fca34b5dbdf36dd31f.zip
Expose marker and indicator numbers for greater customization.
Removed their respective color settings.
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r--modules/textadept/editing.lua24
1 files changed, 10 insertions, 14 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index acd4a5e1..97935f13 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -27,9 +27,8 @@ local M = {}
-- @field STRIP_TRAILING_SPACES (bool)
-- Strip trailing whitespace on file save.
-- The default value is `true`.
--- @field HIGHLIGHT_COLOR (string)
--- The name of the color in the current theme to
--- [highlight words](#highlight_word) with.
+-- @field INDIC_HIGHLIGHT (number)
+-- The word highlight indicator number.
module('textadept.editing')]]
M.AUTOPAIR = true
@@ -37,7 +36,7 @@ M.HIGHLIGHT_BRACES = true
M.TYPEOVER_CHARS = true
M.AUTOINDENT = true
M.STRIP_TRAILING_SPACES = true
-M.HIGHLIGHT_COLOR = not CURSES and 'color.orange' or 'color.yellow'
+M.INDIC_HIGHLIGHT = _SCINTILLA.next_indic_number()
---
-- Map of lexer names to line comment strings for programming languages, used by
@@ -470,11 +469,9 @@ function M.convert_indentation()
buffer:end_undo_action()
end
-local INDIC_HIGHLIGHT = _SCINTILLA.next_indic_number()
-
-- Clears highlighted word indicators and markers.
local function clear_highlighted_words()
- buffer.indicator_current = INDIC_HIGHLIGHT
+ buffer.indicator_current = M.INDIC_HIGHLIGHT
buffer:indicator_clear_range(0, buffer.length)
end
events.connect(events.KEYPRESS, function(code)
@@ -505,13 +502,12 @@ function M.highlight_word()
end
-- Sets view properties for highlighted word indicators and markers.
-local function set_highlight_properties()
- buffer.indic_fore[INDIC_HIGHLIGHT] = buffer.property_int[M.HIGHLIGHT_COLOR]
- buffer.indic_style[INDIC_HIGHLIGHT] = buffer.INDIC_ROUNDBOX
- buffer.indic_alpha[INDIC_HIGHLIGHT] = 255
- if not CURSES then buffer.indic_under[INDIC_HIGHLIGHT] = true end
-end
-events.connect(events.VIEW_NEW, set_highlight_properties)
+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