-
Notifications
You must be signed in to change notification settings - Fork 2
/
highlight.lua
24 lines (20 loc) · 904 Bytes
/
highlight.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- Highlight the active buffer/view.
events.connect(events.INITIALIZED, function()
local line_number_back =
buffer.style_back[_SCINTILLA.constants.STYLE_LINENUMBER]
local current_line_back = buffer.caret_line_back
local function active()
local buffer = buffer
buffer.style_back[_SCINTILLA.constants.STYLE_LINENUMBER] = current_line_back
end
local function inactive()
local buffer = buffer
buffer.style_back[_SCINTILLA.constants.STYLE_LINENUMBER] = line_number_back
end
events.connect(events.VIEW_BEFORE_SWITCH, function() inactive() end)
events.connect(events.VIEW_AFTER_SWITCH, function() active() end)
events.connect(events.BUFFER_AFTER_SWITCH, function() active() end)
events.connect(events.BUFFER_NEW, function() active() end)
events.connect(events.FILE_OPENED, function() active() end)
events.connect(events.RESET_AFTER, function() active() end)
end)