Skip to content
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

Always visible statusline (under prompt) #7635

Closed
wants to merge 1 commit into from
Closed

Always visible statusline (under prompt) #7635

wants to merge 1 commit into from

Conversation

woojiq
Copy link
Contributor

@woojiq woojiq commented Jul 15, 2023

Closes #5758
This PR is a duplicate of #5882 , but not stale.

For now, I quickly fixed it with a non-ideal config name and a strange code style that might be better commented out or simplified.
In #5882 I read that some want it to be a configurable option, some want a permanent layout. So I need to hear the "final" decision from the boss 😃

Demo: https://asciinema.org/a/M3np9Q5K6c9OtShFhadtPASjT

TODO:

  • Choose a better name (always-visible?)
  • Default option true/false?
  • More understandable code (is it understandable without comments? should I add comments? )
  • Rework tests if these changes affect some

@the-mikedavis
Copy link
Member

Could we solve #5758 by rendering the prompt's completion options one higher so that it doesn't overlap with the statusline instead?

Before After
before after
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index a9ccfb73..2f98bfbd 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -375,7 +375,7 @@ pub fn render_prompt(&self, area: Rect, surface: &mut Surface, cx: &mut Context)
 
         let completion_area = Rect::new(
             area.x,
-            (area.height - height).saturating_sub(1),
+            (area.height - height).saturating_sub(2),
             area.width,
             height,
         );

I agree with the comments in #5882 about not wanting a configuration option to change the UI like this and I think prompt above statusline is an odd look.

@pascalkuthe
Copy link
Member

pascalkuthe commented Jul 15, 2023

I peronally also don't think we should make the UI configurable like this but I don't love the look above the statusline either. I prefer the UI to remain unchanged here. I think the usecase in #5758 is a bit niche (being able to see the filename). I think its reasonable to just remember the buffername.

If the buffername is complex then the current file register (#6985) or placeholders like #filename are a better fit

@woojiq
Copy link
Contributor Author

woojiq commented Jul 16, 2023

I fully agree with @pascalkuthe . In case it is still necessary, let me know. I gonna close PR.

@woojiq woojiq closed this Jul 16, 2023
@woojiq woojiq deleted the always-visible-statusline branch July 16, 2023 14:21
@quomat
Copy link

quomat commented Jul 16, 2023

I peronally also don't think we should make the UI configurable like this but I don't love the look above the statusline either. I prefer the UI to remain unchanged here.

@pascalkuthe When speaking of "we shouldn't make UI configurable like this" you mean that the proposed configuration option here specifically or that having ui configurable at all is bad?

I could imagine the whole layout customizable, allowing things like having the command line on the top for example. I personally really like the look proposed here, with upper command line, so I believe it would be useful to users.

@pascalkuthe
Copy link
Member

pascalkuthe commented Jul 16, 2023

#5882 (comment)

We just don't want to make the UI that configurable and in general prefer to add as few config options as possible since that always means more maintenance effort

@zetashift
Copy link
Contributor

We just don't want to make the UI that configurable and in general prefer to add as few config options as possible since that always means more maintenance effort

Completely understand the motivation for this and I agree.

But just out of curiosity: is the "UI being more configurable through a (potential) GUI or through a plugin system" an idea that is plausible?

@pascalkuthe
Copy link
Member

theoretically sure but that is something so distant in the future its not even worth talking about yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to position status line on the top
5 participants