aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-07-16 20:46:06 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2012-07-16 20:46:06 -0400
commitcbda4d355412b7d1132d1d8737d7a7d06ed211e9 (patch)
treeda3b22de0fe3582debf3892ab4fff687be9cf0ac /modules
parentee416479a1b990a325d98f77b07b360c7b025c53 (diff)
downloadtextadept-cbda4d355412b7d1132d1d8737d7a7d06ed211e9.tar.gz
textadept-cbda4d355412b7d1132d1d8737d7a7d06ed211e9.zip
Support highlight word markers in ncurses; modules/textadept/editing.lua
Indicator boxes are not shown since they are overwritten when drawing the text lines.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 06dc5ec7..ea2c1d9f 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -34,7 +34,8 @@ M.AUTOPAIR = true
M.HIGHLIGHT_BRACES = true
M.AUTOINDENT = true
M.STRIP_WHITESPACE_ON_SAVE = true
-M.MARK_HIGHLIGHT_BACK = buffer and buffer.caret_line_back or 0xEEEEEE
+M.MARK_HIGHLIGHT_BACK = buffer and buffer.caret_line_back or
+ (not NCURSES and 0xEEEEEE or 0xFFFF00)
M.INDIC_HIGHLIGHT_BACK = 0x4D99E6
M.INDIC_HIGHLIGHT_ALPHA = 100
@@ -503,9 +504,11 @@ function M.highlight_word()
buffer:set_sel(s, e)
end
+local NCURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ')
-- Sets view properties for highlighted word indicators and markers.
local function set_highlight_properties()
local buffer = buffer
+ if NCURSES then buffer:marker_define(MARK_HIGHLIGHT, NCURSES_MARK) end
buffer:marker_set_back(MARK_HIGHLIGHT, M.MARK_HIGHLIGHT_BACK)
buffer.indic_fore[INDIC_HIGHLIGHT] = M.INDIC_HIGHLIGHT_BACK
buffer.indic_style[INDIC_HIGHLIGHT] = _SCINTILLA.constants.INDIC_ROUNDBOX