helix
helix copied to clipboard
Add layout-direction option for file picker
Add a configuration option for Pickers to define the split-direction
with the possible values of vertical
(default) and horizontal
.
This is how hx looks with the currently implemented vsplit between picker and preview in tall but narrow terminals:
This is the new hsplit-based layout option:
I find that this is way more helpful as paths get clipped less often and I can see more of the relevant lines in the preview.
Note: This is only implemented for the file picker at this time, but it would probably make sense to extend to all pickers with a preview.
Ping? It's been a week and there was no feedback whatsoever.
I think the sense of this is backwards compared to other verbiage in the editor. :vsplit
results in a side-by-side split, whereas here "horizontal" is the side-by-side version. I got confused when i tried out this PR that "switching" it to horizontal had no effect at first.
@EpocSquadron I am happy to switch this around if desired, but this is what every layout I ever ran into uses. And yes, I do find :vsplit behavior surprising:-)
IMO this is almost ready for merge, but there's one remaining nitpick. As it stands, this PR changes the default picker layout direction from how it currently renders. I think we should keep the existing layout as default to avoid surprises.
@EpocSquadron: Thanks for catching that! It would have been embarassing to merge it like that.
I forgot to switch the Default value when I went from "layout-direction" to "split-direction", swtching horizontal/vertical :-)
@EpocSquadron I am happy to switch this around if desired, but this is what every layout I ever ran into uses. And yes, I do find :vsplit behavior surprising:-)
Yeah I found it a bit surprising too (split vertically vs vertical layout of horizontal panes?) but we follow nvim/kakoune for those.
Let's use
@archseer: That's what confused @EpocSquadron :-)
His argument was that people in helix are used to :vsplit
producing what you called a "Horizontal LinearLayout" -- with basically the splitter between the views being vertical. The current implementation tries to match that in both the naming (split-direction
instead of layout-direction
) and by calling your "Horizontal Linear Layout" vertical
.
I am torn myself: On the one hand the direction seems wrong to me now -- based on how other people like CSS and UI toolkits name their layouts. On the other it does feel more consistent with the rest of helix.
@archseer: A added a new patch on top which renames split-direction
to layout-direction
and also switches around the Horizontal
and Vertical
again (defaulting to Horizontal
as it used to be).
I hope that addresses your comment.
It's been another week since I did the requested changes.
Did I miss something or did you just have not had the time to look at this again?
Yes, I've been away for a week. I'll review the changes soon.
What is the status of this PR @hunger? Looks very interesting to me as I often have a relatively narrow editor.
@jhthorsen: Feel free to take over. I have no idea how to fix the remaining issues and I was repeatedly told not to bother people with questions.
Well.. I'm always available for questions.
clsoing this one as stale, there is also a newer pr that implements this. Thank you for contributing!