Created
January 6, 2018 20:18
-
-
Save pkulchenko/44d354e604b79c1ad1810cffb6408cdc to your computer and use it in GitHub Desktop.
Update for highlightselected to work with Output window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/highlightselected.lua b/highlightselected.lua | |
index 14ee4a1..43fa281 100644 | |
--- a/highlightselected.lua | |
+++ b/highlightselected.lua | |
@@ -2,23 +2,30 @@ | |
local updateneeded, cfg | |
local indicname = "highlightselected.selected" | |
+local function onUpdate(event, editor) | |
+ if bit.band(event:GetUpdated(), wxstc.wxSTC_UPDATE_SELECTION) > 0 then updateneeded = editor end | |
+end | |
return { | |
name = "Highlight selected", | |
description = "Highlights all instances of a selected word.", | |
author = "Paul Kulchenko", | |
- version = 0.18, | |
+ version = 0.19, | |
dependencies = "1.20", | |
onRegister = function(package) | |
ide:AddIndicator(indicname) | |
cfg = package:GetConfig() | |
+ ide:GetOutput():Connect(wxstc.wxEVT_STC_UPDATEUI, function(event) | |
+ onUpdate(event, ide:GetOutput()) | |
+ end) | |
end, | |
- onUnRegister = function() ide:RemoveIndicator(indicname) end, | |
- | |
- onEditorUpdateUI = function(self, editor, event) | |
- if bit.band(event:GetUpdated(), wxstc.wxSTC_UPDATE_SELECTION) > 0 then updateneeded = editor end | |
+ onUnRegister = function() | |
+ ide:RemoveIndicator(indicname) | |
+ ide:GetOutput():Disconnect(wxstc.wxEVT_STC_UPDATEUI) | |
end, | |
+ onEditorUpdateUI = function(self, editor, event) onUpdate(event, editor) end, | |
+ | |
onIdle = function(self) | |
if not updateneeded then return end | |
local editor = updateneeded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment