-
-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
renderer/gtk(context-source): Parse the existing contexts. #3266
Conversation
Thank you for this fix! Can you provide me a recipe to test this? I'm not very familiar with the usage of contexts in Nyxt. |
Sure.
|
I see. I personally feel the function of listing the contexts available should be extracted to a function and then invoked by the constructor rather than being fully embedded within the form. What do you think? |
Yes. Done in c574c2f. Merging? |
5e85033
to
4aab100
Compare
Refactored |
@jmercouris please validate. Thanks. |
Looks much better, I will give it a test and then approve! |
That was a mistake... |
Unfortunately it didn't work on my system. I made a context "programming", navigated, then killed the buffer, and it did not appear in the suggestions. I did check My folder looks like this:
|
|
Rewriting
was it working on yours with the trailing slash? If so, how? |
1d56281
to
bd67674
Compare
Right, that's a silly mistake left over from the previous implementation. Fixed now! |
I'll try it again soon. I must re-emphasize, all pull requests should be functional. One should test them before submitting. |
when (uiop:string-suffix-p dirname "web-context") | ||
collect (subseq dirname | ||
0 | ||
(- (length dirname) (length "web-context/"))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Prefer sera:drop
(or sera:slice
) to subseq
.
;; PATHNAME-DIRECTORY returns a list on most implementations (UIOP | ||
;; relies on that, at least), even though the standard doesn't mandate | ||
;; it. | ||
for dirname = (alex:lastcar (uiop:ensure-list (pathname-directory dir))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better and more reliable: files:basename
.
Description
This fixes the problem described in #3124: existing user-defined contexts are only listed if there are buffers with them. So the inactive contexts (the ones having a directory but not used in any buffer) are not listed. This parses the data directory to find context directories and lists them.
Fixes #3124
Discussion
Should we sort contexts for display? Feels like an unnecessary optimization.
Checklist:
Everything in this checklist is required for each PR. Please do not approve a PR that does not have all of these items.
cd /path/to/nyxt/checkout git submodule add https://gitlab.common-lisp.net/nyxt/py-configparser _build/py-configparser
:documentation
s written in the aforementioned style. (It's OK to skip the docstring for really trivial parts.)changelog.lisp
with my changes if it's anything user-facing (new features, important bug fix, compatibility breakage).migration.lisp
entry for all compatibility-breaking changes.(asdf:test-system :nyxt)
and(asdf:test-system :nyxt/gi-gtk)
) and they pass.