Closed moteus closed 4 years ago
Yes, there is some weirdness going on with this handling on linux, so I added some Linux-specific workarounds in the past; for example, see https://github.com/pkulchenko/ZeroBraneStudio/blob/master/src/editor/commandbar.lua#L306-L308. I'll check if this workaround needs to be extended to other cases.
Can you describe the scenario in a bit more detail? For example, when you type :
and then 1
; are you saying that :1
becomes selected, so when you type 2
, it replaces what was selected?
This is what happened when I press Gtrl+G. So if I type a digit
1
I replace a :
symbol.
@moteus, can you check the following patch?
diff --git a/src/editor/commandbar.lua b/src/editor/commandbar.lua
index 691d8704..7fa9a8dd 100644
--- a/src/editor/commandbar.lua
+++ b/src/editor/commandbar.lua
@@ -340,8 +340,8 @@ local function showCommandBar(params)
frame:Refresh()
search:SetValue((defaultText or "")..(selectedText or ""))
- search:SetSelection(#(defaultText or ""), -1)
search:SetFocus()
+ search:SetSelection(#(defaultText or ""), -1)
end
local sep = "[/\\%-_ ]+"
It fixes the issue for me (and doesn't change the behavior on Windows), but would like to confirm before applying. It looks like there is some strangeness with the order of calls on Linux, but this sequence should produce the correct result.
Yes. It works for me too.
On the Ubuntu system when open command bar like navigate to line or function, first special character (
:
or@
) becomes selected, and when I try to type a line number or function name I replace it and I switched tonavigate to file
mode.I have no such problem on the Windows systme