Open aadcg opened 1 year ago
Isn't this https://github.com/atlas-engineer/nyxt/issues/2307 ?
@aadcg, what about starting Nyxt with :verbose t
/-vvv
(-v
should be enough, but -vvv
is a fun tradition)? I remember trying to rebind some built-in keys and getting weird warning messages in the shell.
what about starting Nyxt with
:verbose t
I could do that, but the key point is that there's a bug. The warnings are the least of concerns.
I could do that, but the key point is that there's a bug. The warnings are the least of concerns.
I'm not suggesting it as a fix or whatever, but rather as something that could reveal more details.
I need to look into this more closely.
So I finally went to the bottom of this: the problem has nothing to do with nkeymaps (pfeeew! :p).
Instead, inspect (modes (current-buffer))
and notice that my-mode
is far from being first. Indeed, history-mode is before that, which is why M-f
is still resolving to the history keybinding.
To know more about the resolution from the REPL:
(nkeymaps:lookup-key "M-f" (current-keymaps))
So the problem, really, is "how do we keep a mode in the first position"?
But wait, maybe that's the XY problem... The real problem is how to set global bindings. We have the override-map
for that. Is it enough? @aadcg What do you think?
So the problem, really, is "how do we keep a mode in the first position"?
In my perspective, the problem is that the order of modes as of today matters but it shouldn't. From the user's perspective, it makes little sense. Key clashes should be raised. We would need to think about it carefully nonetheless. The model that Emacs uses doesn't suit our purposes.
But wait, maybe that's the XY problem... The real problem is how to set global bindings.
I think that leveraging global bindings is a way to go around the problem mentioned in the top post.
While this is an issue, I don't think it's a top priority. I consider the workaround good enough as of today.
Example:
In the
emacs
keyscheme,M-f
is bound tohistory-forwards-query
.Write a config file as follows:
Start Nyxt and notice that
M-f
is still bound tohistory-forwards-query
.A warning should perhaps be shown when binding a key that was previously taken.