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

feat: add config option editor.statusline.unobtrusive to make statusline not block the last line of text #12020

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nikitarevenco
Copy link

@nikitarevenco nikitarevenco commented Nov 7, 2024

per popular request: How to disable / remove statusline? #7934


This PR adds a new editor.statusline.unobtrusive (boolean) option

Previously, the statusline would always block one line of the screen. But now, if this option is set then the statusline elements will be overlaid on top of the bottom line of text without blocking that line

Showcase

With the following config, the text on line 23 is not visible.

[editor.statusline]
unobtrusive = false # default
center = []
left = []
right = ["spinner", "file-name", "diagnostics"]

And setting unobtrusive = true makes the text on line 23 visible.

[editor.statusline]
unobtrusive = true
center = []
left = []
right = ["spinner", "file-name", "diagnostics"]

Notes

  • The background color of the status line gets applied regardless, this is required because otherwise with multiple vertically stacked buffers it is very hard to tell where one buffer ends and another one starts:

Since people use their text editors with other software like multiplexers, having an entire line blocking the text isn't good for integrations.

With this config, you can hide all of the status line's elements:

[editor.statusline]
unobtrusive = true
center = []
left = []
right = []

Most notable changes are in these files:

  • In the render method in helix-term/src/ui/statusline.rs:52
  • In the inner_area and inner_height methods in helix-view/src/view.rs:193

Most other changes were just passing the unobtrusive_statusline argument

  • This is my first time writing any Rust code, just saying in case I broke some best practices or something :)

@nikitarevenco nikitarevenco changed the title feat: add config option to make statusline unobtrusive feat: add config option to make statusline not block the last line Nov 7, 2024
@nikitarevenco nikitarevenco changed the title feat: add config option to make statusline not block the last line feat: add config option to make statusline not block the last line of text Nov 7, 2024
@nikitarevenco nikitarevenco changed the title feat: add config option to make statusline not block the last line of text feat: add config option editor.statusline.unobtrusive to make statusline not block the last line of text Nov 8, 2024
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.

1 participant