helix icon indicating copy to clipboard operation
helix copied to clipboard

Improve appearance of diagnostics messages

Open twharmon opened this issue 2 years ago • 7 comments

A few opinions:

  1. The diagnostic messages need a right margin. It looks awful with characters on the edge.
  2. Distinct diagnostic messages need a margin between them to indicate the messages are separate.
  3. The maximum width of the area for messages needs to be significantly smaller. Long messages are hard to read when wrapped.
  4. The messages need to be left aligned.

This is better: image

twharmon avatar Nov 01 '22 17:11 twharmon

4. The messages need to be left aligned.

The design was based on lsp-mode which right aligns: https://emacs-lsp.github.io/lsp-mode/

archseer avatar Nov 02 '22 02:11 archseer

  • The diagnostic messages need a right margin. It looks awful with characters on the edge.

  • Distinct diagnostic messages need a margin between them to indicate the messages are separate.

That consumes more space on the UI though, the diagnostics area is already way too big on a smaller terminal.

3. The maximum width of the area for messages needs to be significantly smaller. Long messages are hard to read when wrapped.

I already downsized this from 120 to 100 which was the lsp-mode default. 60 is even smaller than what used to be the code wrapping standard at 80. It works well if the diagnostic is mostly text, but wrapping code samples over several lines is a lot harder for me to read.

archseer avatar Nov 02 '22 04:11 archseer

  1. The link to emacs screen shot at least has the right margin. Surely we can at least change that.

  2. As for the space between messages, if space is more important than readability, then let's not add the additional space in there.

Which language and scenario will produce diagnostic messages with that much code? I'd expect right-aligned code to be hard to read.

twharmon avatar Nov 02 '22 23:11 twharmon

This is better: <the above image>

@twharmon Excuse me for the unrelated question, but how did you set up the mode names down in the statusline to their full form?

Manosmer avatar Nov 03 '22 20:11 Manosmer

This is better:

@twharmon Excuse me for the unrelated question, but how did you set up the mode names down in the statusline to their full form?

@Manosmer

[editor.statusline]
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"

twharmon avatar Nov 04 '22 02:11 twharmon

I think having the mode names in full looks much better, so I started a poll to see what people think: https://github.com/helix-editor/helix/discussions/4589

David-Else avatar Nov 04 '22 13:11 David-Else

Thanks @twharmon for the PR.

The left vs right alignment and the addition space for readability vs not can all be made configurable.

As @archseer mentioned the case of smaller displays, they can go with compact mode and people with larger monitors can go for easy fit. The Diagnostic messages today are very hard to read.

blitzerr avatar Jan 13 '23 06:01 blitzerr

@archseer Any new thoughts on this?

I have a branch with this config possible:

[editor.diagnostics]
top-margin = 1
right-margin = 0
width = 100
height = 15

Perhaps adding align as well would help.

twharmon avatar Aug 23 '23 17:08 twharmon