-
Notifications
You must be signed in to change notification settings - Fork 715
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
Add terminal_info_inline_borders option #5102
Open
raiguard
wants to merge
1
commit into
mawww:master
Choose a base branch
from
raiguard:terminal-ui-info-inline-borders
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should be the default except maybe for tiny info boxes that only span one line.
Also isn't it a bit weird that this is an option? I can imagine wanting two info boxes with different styles in the same window. For example
lsp-signature-help
is just one line so it shouldn't have borders whilelsp-hover
does want borders. So shouldn't it be a flag toinfo
? Even more so because info already has a border by default. Onlyinfo -style
doesn'tThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea behind the option was to avoid changing the default behavior, because I assumed the default behavior was the way it was for a reason. I would not complain if the default was changed and the option was removed.
As for single line boxes, I think it should still draw borders then. The whole point is that with my color scheme it is really difficult to distinguish what's in an info box and not because it doesn't use a super high contrast background.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a tricky problem, the reason i did not make the inline info bordered was to make it possible to align info with the anchor position. For example
ctags-enable-autoinfo
will display the info box aligned on the(
opening the function call. Additionally, borders on small, inline info boxes hide a lot more of the buffer.I initially thought a switch on the
info
command made most sense, but info box borders are a UI only concept, so adding this to the info command would move that knowledge in the UI agnostic part of Kakoune. I think we should find a switch/info style name that hints the UI it can use borders. That said, it seems the root of the issue is @raiguard colorscheme not distinguishing clearly info boxes background, maybe changing that would be a better fix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason my colorscheme has a low-contrast info box background is so that I can have syntax coloring in the info boxes. Especially in large projects, it makes LSP information much easier to parse:
One Darker:
Gruvbox Dark:
I have trouble reading (potentially dyslexia, but not diagnosed yet) so syntax highlighting is an enormous help for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it work to use a high enough color difference between Default and Information backgrounds so that its clear you are looking at an info box while still keeping Information background dark enough so that highlighted code looks okay ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps. But the reality is that having the border will always make it easier to read. Instead of having characters directly next to each other only separated by color, it has a very clear and easy to parse separation. In my opinion it is a significant improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With
ctags-enable-autoinfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this autoinfo was trying to align its opening
(
to the one in the file (it is not anchored on the cursor), but cannot anymore because it would need to predict if a border is applied and how many characters it adds. Once you remove the ability to align it begs the question of why we have parenthesis in that info box in the first place...On the other hand, I was envisioning the info boxes to be allowed to use a different font / font size on GUI implementations, which would also introduce the same issue breaking info alignement to buffer text.
I am still not fully sold on that change because it feels like allowing scripts to align info to buffer content is a nice feature, and I think the readability concern can be solved with the colorscheme.