Closed moteus closed 2 years ago
@moteus, I can't reproduce this. A couple of questions: 1) can you try on the current master with an empty config, and 2) do you have acandtip.strategy
value set in the config?
@moteus, do you still have this issue? Any additional information?
Sorry for delay. This issue still exists, but I have no time to test it with clean setup. I will reopen this issue when make more test
PS. In my config I have acandtip.strategy=2
I think I found a problem. At first I figured out that after autocomlite list shows editor stops handling idle and update ui events. Then In wxEVT_STC_PAINTED handler I found this lines. After I comment them out all start working as expected.
@moteus, Interesting; thank you for the update.
I'm good with removing those if that fixes the issue for you, but I find it disappointing that I have not been able to reproduce the issue.
Can you test with editor.usewrap = false
, as this is what that fragment was fixing for #250? I suspect that the issue might have been fixed in scintilla/wxwidgets already, so should be safe to remove, but would like to confirm.
I have in my config editor.usewrap = false
. And when I remove it all works as expected.
Basic way to reproduce my issue is may be add e.g. ide:Print(os.time())
to wxEVT_IDLE
handler.
Then after autocomplite shows this print should stop writing to output
In fact when autocomplite shows output do not refresh at all as whell. Only if it resized.
Then after autocomplite shows this print should stop writing to output
This is usually an indication that something fails in the event handler and is not reported (as it's happening in a different coroutine).
Can you wrap the content of the wxEVT_IDLE
and wxEVT_STC_UPDATEUI
handlers (and whatever else you suspect may be failing) into a pcall to see what error may be reported:
editor:Connect(wxstc.wxEVT_STC_UPDATEUI,
function (event)
ide:Print("UPDATEUI", pcall(function() --<-- add this line
-- original content here
end)) --<-- add this line
end) -- this is the end of the UPDATEUI handler
Thank you!
I wrap all editor hanlers like
local Connect = editor.Connect
function editor:Connect(...)
local connect_args = {...}
local handler = connect_args[#connect_args]
connect_args[#connect_args] = function(...)
local event_args = {...}
local ok, err = pcall(function() handler(unpack(event_args)) end)
if not ok then
tprint{os.date('%H:%M:%S: '), connect_args[2], error = err}
end
end
return Connect(self, unpack(connect_args))
end
And there no errors
Also, I found that only editor:Refresh()
causes a problem. Without this call all works.
Also, its possible to call EditorAutoComplete
directly (not via editor:DoWhenIdle
) and it also solves the problem.
@moteus, should be fixed now. BTW, I was able to reproduce this issue you're describing, but only using an older version of wxwidgets (3.1), so it seems like it's been addressed/fixed in the current version (3.1.4). It's strange that it still happens for you. In any case, the original issue the workaround was for was also addressed, so removing it should be just fine now.
Thank you for the report!
My setup righ now is Built with wxWidgets 3.1.4, wxLua 3.0.0.8, Scintilla 3.7.2
In this example I type a![image](https://user-images.githubusercontent.com/1804306/115991559-bea27d80-a5d1-11eb-97c1-557c00d0ba53.png)
pr
and after that autocomplite list shows.But after I type a![image](https://user-images.githubusercontent.com/1804306/115991569-ce21c680-a5d1-11eb-95c0-0fb4da5efea0.png)
i
autocomlite list looses focusAnd in this case if I press enter a new autocomplite list creates![image](https://user-images.githubusercontent.com/1804306/115991770-a41cd400-a5d2-11eb-9f43-00f0eed06861.png)