Commit graph

2630 commits

Author SHA1 Message Date
5646a73a69 Merge remote-tracking branch 'upstream/master' 2025-01-18 09:56:49 +01:00
Nikita Revenco
076d8bd173
fix: surprising behaviour when changing line above a comment (#12575)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-01-17 15:29:39 -06:00
Michael Davis
69068770c8
Add extra logging for external formatters and formatting errors
This should help debug formatting failures when using external
formatters in the future. Previously we didn't log anything when an
external formatter failed despite having a custom error type for it.
2025-01-17 11:00:34 -05:00
Michael Davis
4c41c5250c
Eliminate an unnecessary clone in insert_newline 2025-01-17 10:23:36 -05:00
janos-r
d4ee22b483
Generate a .deb file (#12453) 2025-01-16 17:37:53 -06:00
Michael Davis
3318953bf6
minor: Use more exact allocations in insert_newline
This is partially a style commit:

* Pull more bindings out the `change_by_selection` closure like the
  line-ending string and the comment tokens used for continuation.
* Prefer `Editor::config` to `Document`'s config.

The rest is changes to places where `insert_newline` may allocate.

The first is to move `new_text` out of the `change_by_selection`
closure, reusing it between iterations. This is not necessarily always
an improvement as we need to clone the text for the return type of the
closure. `SmartString`'s `From<String>` implementation reuses the
allocation when the string is too long to inline and drops it if it is
short enough to inline though which can be wasteful. `From<&String>`
clones the string's allocation only when it is too long to be inlined,
so we save on allocations for any `new_text` short enough to be inlined.

The rest is changes to `new_text.reserve_exact`. Previously calls to
this function in this block mixed up character and byte indexing by
treating the length of the line-ending as 1. `reserve_exact` takes a
number of bytes to reserve and that may be 2 when `line_ending` is a
CRLF. A call to `reserve_exact` is also added to the branch used when
continuing line comments.
2025-01-15 10:57:03 -05:00
Michael Davis
4bd17e542e
Fix offset tracking in insert_newline
#12177 changed `insert_newline`'s behavior to trim any trailing
whitespace on a line which came before a cursor. `insert_newline` would
previously never delete text. Even the whitespace stripping behavior in
#4854 worked by inserting text - a line ending at the beginning of the
line. `global_offs`, a variable that tracks the number of characters
inserted between iterations over the existing selection ranges, was not
updated to also account for text deleted by the trimming behavior,
causing cursors to be offset by the amount of trailing space deleted
and causing panics in some cases.

To fix this we need to subtract the number of trimmed whitespace
characters from `global_offs`. `global_offs` must become an `isize`
(was a `usize`) because it may become negative in cases where a lot of
trailing whitespace is trimmed. Integration tests have been added for
each of these cases.

Fixes #12461
Fixes #12495
Fixes #12539
2025-01-15 10:36:29 -05:00
1eca7cf512 fix: Use correct args type 2025-01-14 21:05:47 +01:00
a0ca976c99 Merge remote-tracking branch 'upstream/master' 2025-01-14 20:55:31 +01:00
c444af66fb Merge remote-tracking branch 'color-completion/colored-color-completions-fix' 2025-01-14 20:51:56 +01:00
TornaxO7
60bff8feee
Fix open_{below, above} behaviour with multiple cursors (#12465) 2025-01-13 08:14:30 -06:00
Nikita Revenco
e01775a667
fix: unable to detect Color completion item hex code for some LSPs (#12501)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-01-12 09:40:19 -06:00
Nikita Revenco
5d9ce3abf2
chore: improve wording in comment
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-01-12 15:21:34 +00:00
Nikita Revenco
49c7844a6e
fix: fix potential underflow
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-01-12 15:21:12 +00:00
Nikita Revenco
ed66e7e104 chore: add docs 2025-01-12 11:57:39 +00:00
99a3c56df3 Merge remote-tracking branch 'color-completion/colored-color-completions-fix' 2025-01-12 10:32:11 +01:00
Nikita Revenco
a65dba181b fix: check for the color pattern against the end 2025-01-12 08:49:19 +00:00
Michael Davis
0f2ce303c5
Add directory name to :cd errors
For example `:cd README.md` would say "Not a directory" but would not
print the directory name. Now the error message includes some context
about the operation and requested directory.
2025-01-11 20:39:44 -05:00
0cffc49cbb Merge remote-tracking branch 'filebrowser/add-file-browser' 2025-01-09 17:45:18 +01:00
82e09c04a0 fix: Broken trim_whitespace fn 2025-01-09 17:44:52 +01:00
0f2fbd2b6f Merge remote-tracking branch 'helix-pull/pull-diagnostics' 2025-01-09 17:39:40 +01:00
rhogenson
931dd9c1dc
Fix a typo in join_selections (#12452)
Co-authored-by: Rose Hogenson <rosehogenson@posteo.net>
2025-01-08 08:42:41 -06:00
Denys Rybalka
996ee93e41
Normalize path in file browser 2025-01-08 08:26:11 +01:00
Michael Davis
917174e546
Fix blank buffer picker preview on doc with no views
Reproduction:

* `hx`
* Open any file in a split (`<space>f` and choose anything with `<C-v>`)
* Close the split with `<C-w>q`
* Open up the buffer picker and look the file you opened previously

Previously the preview was empty in this case because the Document's
`selections` hashmap was empty and we returned early, giving `None`
instead of a FileLocation. Instead when the Document is not currently
open in any view we can show the document but with no range highlighted.
2025-01-07 15:11:15 -05:00
dependabot[bot]
e698b20245
build(deps): bump the rust-dependencies group with 3 updates (#12437) 2025-01-06 19:34:21 -05:00
Michael Davis
217818681e
Revert "refactor(shellwords)!: change arg handling strategy (#11149)"
This reverts commit 64b38d1a28.
2025-01-06 12:39:53 -05:00
RoloEdits
f80ae997f2
perf: cache Documents relative path (#12385) 2025-01-05 16:29:16 -06:00
Sofus Addington
69025dde28
Pull diagnostics 2025-01-05 20:52:59 +01:00
RoloEdits
64b38d1a28
refactor(shellwords)!: change arg handling strategy (#11149) 2025-01-05 12:18:30 -06:00
4762371504
Merge remote-tracking branch 'RoloEdits/icons-v2' 2025-01-04 18:22:19 +01:00
Rolo
b587baa728 refactor: tweak with bufferline icon spacing 2025-01-04 09:03:30 -08:00
Rolo
e1476b37b5 refactor: small renames for better clarity 2025-01-04 09:03:30 -08:00
Rolo
041192eaae refactor: remove Default impls and add config parsing 2025-01-04 09:03:30 -08:00
Rolo
39638b6394 feat: add support for basic icons 2025-01-04 09:03:30 -08:00
5ae34222e2
Merge remote-tracking branch 'irh/clickable-bufferline' 2025-01-04 17:56:48 +01:00
6589a46e12
Merge remote-tracking branch 'nikitarevenco/toggle-diagnostics' 2025-01-04 17:53:44 +01:00
b1ea2cd7db
Merge remote-tracking branch 'merge-status-line/merge-statusline-cmdline' 2025-01-04 17:33:43 +01:00
63517ee4e7
Merge remote-tracking branch 'trim/trailing-whitespace' 2025-01-03 17:02:40 +01:00
1904e7e669
Merge remote-tracking branch 'upstream/master' 2025-01-03 16:57:23 +01:00
5ffffdee69
Merge remote-tracking branch 'filebrowser/add-file-browser' 2025-01-03 16:55:29 +01:00
7e2bdbe6df
Merge remote-tracking branch 'backup/open' 2025-01-02 14:22:06 +01:00
kirawi
d75bafac8a try uid test again 2024-12-31 01:20:52 -05:00
Jean Abou Samra
9cc056e755
fix (hx --health): Don't print headers in white (#12355) 2024-12-29 10:38:28 -06:00
Michael Davis
073efe48f9
minor: Setup default keymap directly in xtask docgen
Instantiating EditorView is a lot of machinery which is unnecessary:
the default keymap is exposed through the `default` function in the
keymap module.
2024-12-28 21:42:09 -05:00
RoloEdits
19c91dfb80
fix: string literals with format args not in format! (#12354) 2024-12-28 07:44:16 -06:00
65628d53e4
Merge remote-tracking branch 'color-swatches/textDocument/documentColor' 2024-12-27 21:42:33 +01:00
018f64124f
Merge remote-tracking branch 'helix-pull/pull-diagnostics' 2024-12-27 21:39:29 +01:00
Sofus Addington
74a9e9e425
Pull diagnostics 2024-12-27 19:07:14 +01:00
e70ebf7df4
Merge remote-tracking branch 'upstream/master' 2024-12-26 23:36:52 +01:00
Nikita Revenco
aca9b4f158 refactor: inline_annotations_range moved to be on Document 2024-12-25 18:36:42 +00:00