Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.46k stars 948 forks source link

[Bugfix] fixes hidden segment on last line #1278

Closed Syphdias closed 5 years ago

Syphdias commented 5 years ago

This fixed a bug where the last line is not properly rendered if there is a hidden segment at the end:
P9K_LEFT_PROMPT_ELEMENTS=(dir newline background_jobs newline dir_writable) image

This PR initially was created to fix #1266. What this does not change is the displaying of the "triangle" (LEFT_SEGMENT_SEPARATOR) at the end on newline. Currently the triangle is not shown if there is no segment on this line. This could be considered a bug as @romkatv notes, depending on if want that or not. So the question is: Should the triangle be displayed on empty lines? If no, this PR is finished (unless the review brings something up), if so, I could expand on this PR.

bhilburn commented 5 years ago

Nice fix, @Syphdias, and thanks to linking to the comment from Roman.

I think he has a good point - there should be consistent indication of a rendered line, otherwise it appears as though the line above it contained an \n when it didn't, which can really matter for things like text parsing / REPL.

Can you add the triangle to the empty line? Aside from that, this looks good! =)

dritter commented 5 years ago

Thx @Syphdias .

Syphdias commented 5 years ago

I think he has a good point - there should be consistent indication of a rendered line, otherwise it appears as though the line above it contained an \n when it didn't, which can really matter for things like text parsing / REPL.

@dritter are you aware that I didn't come around to implementing the changes @bhilburn suggested?