* check selection's visible width when copying on mouse click
Mouse-click-up copies the selection produced by dragging. The event
is ignored if the selection has a width of 1 though so you don't
copy when clicking rather than dragging. The current check copies
text when it has a visible width of 1 but is actually multiple
characters in the rope like a CRLF line-ending. With this change
we check the unicode width of the character(s) in the selection
rather than the range length, so clicking on a CRLF line-ending
does not copy.
* use range.fragment to simplify getting the primary selection width
* redetect indent and line endings after language server replaces document
* removes nested if
* always redetect indent and line endings after format
This reverts commit 764d14f55894dc7213e48022dfa0f91829b8ef59.
The scrollbar length used to increase with more entries in the menu,
which was counter-intuitive to how scrollbars worked in most
applications. Turns out there was a typo in the floor division
implementation :)
The command palette previously used + as a delimiter for denoting
a single key in a key sequence, (like C+w). This was at odds with
how the statusline displayed them with pending keys (like <C-w>).
This patch changes the palette formatting to the statusline formatting
* feat: make `move_vertically` aware of tabs and wide characters
* refactor: replace unnecessary checked_sub with comparison
* refactor: leave pos_at_coords unchanged and introduce separate pos_at_visual_coords
* style: include comment to explain `pos_at_visual_coords` breaking condition
* refactor: use `pos_at_visual_coords` in `text_pos_at_screen_coords`
* feat: make `copy_selection_on_line` aware of wide characters
* Default rulers color to red
Currently if the theme a user is using doesn't have `ui.virtual.rulers`
set and they set up a ruler it just fails silently making it really hard
to figure out what went wrong. Did they set incorrectly set the ruler?
Are they using an outdated version of Helix that doesn't support rulers?
This happened to me today, I even switched to the default theme with
the assumption that maybe my theme just doesn't have the rulers setup
properly and it still didn't work.
Not sure if this is a good idea or not, feel free to suggest better
alternatives!
* Use builtin Style methods instead of Bevy style defaults
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Only default the style if there's no ui or ui.virtual
* Update themes style from ui.virtual to ui.virtual.whitespace
* Revert ui.virtual change in onelight theme
* Prefer unwrap_or_else
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Display highest severity diagnostic in gutter
* Improve gutter diagnostic performance
Very slight improvement (doesn't really make a difference), iterates over the diagnostics of the line
once instead of twice.
* Add comment justifying unwrap
This change moves the configuration tables from the Adding
Languages guide into the overall Languages section. It also
adds more detailed documentation on the `language-server`
configuration key and fixes a typo in the "mylang" example
(the scope was `scope.mylang` instead of `source.mylang`).
During write-quit, if the file fails to be written for any reason, helix
will still quit without saving the changes. This fixes this behavior by
introducing fallibility to the asynchronous job queues. This will also
benefit all contexts which may depend on these job queues.
Fixes#1575