-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Refactor statusline elements to build Spans
#9122
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hamrik
force-pushed
the
statusline_spans
branch
2 times, most recently
from
December 19, 2023 23:44
f33c807
to
57abe53
Compare
kirawi
added
C-enhancement
Category: Improvements
A-helix-term
Area: Helix term improvements
labels
Dec 22, 2023
hamrik
force-pushed
the
statusline_spans
branch
from
January 1, 2024 22:21
57abe53
to
083cca0
Compare
hamrik
force-pushed
the
statusline_spans
branch
from
January 14, 2024 15:42
083cca0
to
c572978
Compare
hamrik
force-pushed
the
statusline_spans
branch
2 times, most recently
from
January 27, 2024 19:45
083cca0
to
f85c996
Compare
hamrik
force-pushed
the
statusline_spans
branch
from
February 20, 2024 23:17
f85c996
to
784479a
Compare
hamrik
force-pushed
the
statusline_spans
branch
2 times, most recently
from
March 8, 2024 19:56
6245d05
to
2eb1a91
Compare
archseer
previously approved these changes
Mar 19, 2024
the-mikedavis
previously approved these changes
Mar 19, 2024
This just needs a rebase / master merge to resolve the conflicts |
hamrik
force-pushed
the
statusline_spans
branch
from
March 19, 2024 15:58
2eb1a91
to
3543ec7
Compare
Rebase done! |
the-mikedavis
approved these changes
Mar 19, 2024
pascalkuthe
approved these changes
Mar 19, 2024
Desdaemon
pushed a commit
to Desdaemon/helix
that referenced
this pull request
Mar 26, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
postsolar
pushed a commit
to postsolar/helix
that referenced
this pull request
Apr 4, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
postsolar
pushed a commit
to postsolar/helix
that referenced
this pull request
Apr 4, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
postsolar
pushed a commit
to postsolar/helix
that referenced
this pull request
Apr 4, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
postsolar
pushed a commit
to postsolar/helix
that referenced
this pull request
Apr 20, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
hamrik
added a commit
to hamrik/helix
that referenced
this pull request
Apr 30, 2024
)" This reverts commit bcf7b26.
archseer
pushed a commit
that referenced
this pull request
May 6, 2024
mtoohey31
pushed a commit
to mtoohey31/helix
that referenced
this pull request
Jun 2, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
Vulpesx
pushed a commit
to Vulpesx/helix
that referenced
this pull request
Jun 7, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
Vulpesx
pushed a commit
to Vulpesx/helix
that referenced
this pull request
Jun 7, 2024
Chirikumbrah
pushed a commit
to Chirikumbrah/helix
that referenced
this pull request
Jun 15, 2024
smortime
pushed a commit
to smortime/helix
that referenced
this pull request
Jul 10, 2024
* Refactor statusline elements to return Spans * Split render fn to build Spans and blit to Surface
smortime
pushed a commit
to smortime/helix
that referenced
this pull request
Jul 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current statusline implementation uses ad-hoc write callbacks to render statusline elements. This make statusline elements hard to work with, because we get no useful information about their output.
This PR refactors these elements to work more like widgets: each
render_*
function returns aSpans
, which can be combined into a complete statusline. This has remained the responsibility of therender
function.This PR also separates the
render
function into two parts:render_statusline
combines the aforementioned elements into one largeSpans
with given size constraints, whilerender
blits it to a givenSurface
as it has done so previously.The rationale behind this is to allow post-processing the widget outputs and to make decisions based on them.
For example, in the future we can now check if the statusline is empty and autohide it. Or revisit #7310 and automatically space the elements.
This is merely a refactor; the current apparent behavior of each statusline element should be identical to previous versions.