Closed andrei-a-papou closed 6 months ago
Hm, this is strange, I’ll look into it while looking into #33.
Do you have a specific case, i.e. an example key that you want to bind to select-file
?
Sure, how about ^F = select-file
. It would also be great to do ^A = go-bol
and ^E = go-eol
(a-la Emacs) -- but these are also ignored.
Wow, apparently nobody ever tried to do this before. Looks like [Editor:Keys]
is pretty much ignored, but you can add ^A = go-bol
in the regular [Keys]
section to make that work… :zany_face:
I’m fixing it now to be in line with the documentation.
This should work fine now in the new version 3.15.0; please let me know if something’s still strange or functionality for the edit fields is missing!
@vonshednob thanks for the quick response, I've installed 3.15.0 and I can now assign new shortcuts under [Editor:Keys]
. However, I still cannot remove any bindings there via the nop
command.
Here's the relevant portion of the config file:
[Editor:Keys]
^C = cancel
<escape> = cancel
<return> = submit-input
<left> = go-left
<right> = go-right
<home> = go-bol
<end> = go-eol
^A = go-bol
^E = go-eol
<backspace> = del-left
<del> = del-right
^U = del-to-bol
<f6> = nop
^F = select-file
# unbind `comp-next` and `comp-prev`:
^N = nop
^P = nop
And here's what the log file says:
[ERROR] nop is not a function of editor or completion
[ERROR] nop is not a function of editor or completion
[ERROR] nop is not a function of editor or completion
This new release now also produces the following warnings in the log:
[WARNING] Cannot bind <down> to 'next-item': no such function
[WARNING] Cannot bind <up> to 'prev-item': no such function
[WARNING] Cannot bind <pgup> to 'page-up': no such function
[WARNING] Cannot bind <pgdn> to 'page-down': no such function
[WARNING] Cannot bind <home> to 'first-item': no such function
[WARNING] Cannot bind <end> to 'last-item': no such function
[WARNING] Cannot bind <return> to 'select-item': no such function
The warnings definitely weren't there with 3.14.0
Yeah, because next-item
, prev-item
, page-up
, etc (all "no such function") belong in the [Keys]
section. It was part of the bug that they were taken from [Editor:Keys]
. Sorry for the confusion!
Hmm... but I don't have next-item
, prev-item
, page-up
, etc under [Editor:Keys]
, only under [Keys]
. So why is pter printing warnings about the above bindings in 3.15.0?
Here's the relevant portion of my [Keys]
section:
[Keys]
<down> = next-item
<up> = prev-item
<pgup> = page-up
<pgdn> = page-down
<home> = first-item
<end> = last-item
<colon> = nop
^F = search
^K = clear-search
Hm, that’s a bug alright! Maybe related to this fix, maybe already broken earlier, but broken either way.
Sorry for the inconvenience…
No problem! There's also the issue of nop
not working under [Editor:Keys]
. I'll be happy to test the fix and then we can properly close it!
Alright, version 3.15.1 is out -- give it a spin!
Thank you, the nop
problem is gone, nice!
I'm still getting a bunch of warnings in the log though:
In my pter.conf
all these functions are in Keys
, not Editor:Keys
, so I'm not sure why pter is complaining. Any ideas?
Yeah, as with most of these things: I wrote the code, I introduced a bug :unamused:
I’ll fix it later today. Sorry for the constant bouncing around between bugs and failed attempts at fixing.
Thanks, I'll be happy to test the fix.
Well, let's see. Maybe third time's the charm. 3.15.2 should do the trick!
Third time's the charm, precisely!
IMO, a great appeal of pter is that it's entirely keyboard-driven and the shortcuts can be redefined to fit the end-users preferences. However, right now doesn't seem to be possible to redefine or unset the editor keys.
For example, I'd like to change
select-file
shortcut, but pter seems to ignore myEditor:Keys
section. Enabling debug logging shows that pter applies the keys from theKeys
section while ignoringEditor:Keys
.