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

Nullspace rendering: limiting the text view width #11409

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

smbroadley
Copy link

@smbroadley smbroadley commented Aug 2, 2024

Allow the text (and gutter) to centre into the view when rendering.

image

Style

Can be styled with ui.nullspace (falls-back to ui.linenr).

config.toml

[editor]
nullspace.enable = true
nullspace.pattern = "/" # optional (only uses first char for now)

Uses option text_width as the limiting-width of the text area.

Known Issues

  • Clicking in nullspace toggles breakpoints on that line
  • Mouse scroll in nullspace does not scroll the doc
  • sh output renders in wrong place initially

Potential Improvements

  • Mouse drag in nullspace to select multiple lines
  • Use all chars in the pattern, inc. newlines for juicy patterns
  • Used as render area for diagnostics
  • Allow different modes (pull-to-centre of editor surface, rather than centre of view)

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Aug 4, 2024
@archseer
Copy link
Member

archseer commented Aug 9, 2024

Is this any different than zen mode?

@smbroadley
Copy link
Author

Zen mode would remove everything except the code view (if we go by VS Code's excellent example of a Zen mode).

This does not do that, but it does introduce a part of the solution for Zen mode; centred views.

I wrote this as I work on a 32:9 UWS monitor, and I was getting neck ache from looking 'hard-left' for so long editing single files with Helix.

Ideally, I would like to introduce a layout mode that means it 'pulls' content into the centre of the screen, so that if I open a second window, the two pages would sit next to each other in the centre of the screen (this is also different to VS Code's Zen mode).

This is not trivial at the moment as the layout pass determines the rendering area, without giving the original available area that was subdivided, so I'm just tinkering with making that available. I also use Tmux to have a Zsh at hand at all times, so this simple solution might not be completely fool proof either, but honestly it would still be a huge improvement for me.

In short, there is stuff I want to do that would move this even further away from 'Zen Mode' functionality, and it is already quite far from it as it stands, as it does not remove buffer-line, status-line, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants