Commit graph

4338 commits

Author SHA1 Message Date
Pascal Kuthe
9fac574178 do not ignore mouse scrolling when on top of virtual text 2023-03-27 09:54:40 +09:00
Pascal Kuthe
15e751b9a2 make scrolloff calculation consistent
While scrolling (with the `scroll`) command scrolloff was calculated
slightly differently than in `ensure_cursor_in_view` which could cause
the cursor to get stuck while scrolling
2023-03-27 09:54:40 +09:00
Pascal Kuthe
d6c8e0c946 allow scrolling past virtual text line
Virtual text lines (either caused by softwrapped inlay hints that take
multiple or line annotations) currently block scrolling downwards.

if the visual offset passed to char_idx_at_visual_offset or
visual_offset_from_block is within a virtual text line then the char
position before the virtual text and a visual offset are returned.
We previously ignored that visual offset and as a result the cursor
would be stuck at the start of the virtual text. This commit fixes
that by simply moving the cursor to the next char (so past the virtual
text) if this visual offset is non-zero
2023-03-27 09:54:40 +09:00
Pascal Kuthe
7cf448eb5b use partition_point instead of binary_search_by
Using `partition_point` ensures we always find the first entry.
With binary search it is "random" (deterministic but implementation
specific) which index is retruned if there are multiple equal elements.
`partition_point` was added to the standard library to cover extactly
the usecase here.
2023-03-27 09:54:40 +09:00
Pascal Kuthe
72b9311678 fix view anchors not at start of a visual line
The top of a view is marked by a char idx anchor. That char idx is
usually the first character of the visual line it's on. We use a char
index instead of a line index because the view may start in the middle
of a line with soft wrapping. However, it's possible to temporarily
endup in a state where this anchor is not the first character of the
first visual line. This is pretty rare because edits usually happen
inside/after the view. In most cases we handle this case correctly.

However, if the cursor is before the anchor (but still in view)
there can be crashes or visual artifacts. This is caused by the fact
that visual_offset_from_anchor (and the positioning code in view.rs)
incorrectly assumed that the (cursor) position is always after the
view anchor if the cursor is in view. But if the anchor is not the
first character of the first visual line this is not the case anymore.

In that case crashes and visual artifacts are possible. This commit
fixes that problem by changing `visual_offset_from_anchor` (and
callsites) to properly consider that case.
2023-03-27 09:54:40 +09:00
Pascal Kuthe
0ab96cc257 remove incorrect assert
This assert was added during early development of #5420 and makes no
sense with the current code. We simply forgot to remove it.
2023-03-27 09:54:40 +09:00
JJ
c8fde8b6f9
Initial Nim language support (#6123) 2023-03-26 17:06:48 -05:00
Juan C. Müller
5d7c90c5cf
Add language support for rego (OpenPolicyAgent) (#6415) 2023-03-26 16:49:37 -05:00
Pascal Kuthe
abef92a9b3
log failures in the git integration (#6441) 2023-03-26 17:44:07 +08:00
Tom Burdick
685ae2365a
Add vhdl language support (#5826)
Simple highlight query file with keywords and builtin types
matching. Many VHDL types however are defined in std libraries
which do not currently get matched on.

This is because the grammar doesn't consider them builtin types.
2023-03-25 12:10:54 -05:00
Erasin Wang
851ac6cdd3
Add theme keys for (un)checked markup list items (#6434) 2023-03-25 11:41:31 -05:00
Matouš Dzivjak
2f64c768df
feat(languages): highlight .svg as xml (#6431)
Add "svg" as a file type for xml.

Fixes: https://github.com/helix-editor/helix/issues/6337
2023-03-25 08:40:19 -05:00
Alexis-Lapierre
9a65118899
Recognize .cts and .mts file type as TypeScript (#6424)
TypeScript can use three type of file extensions:
  - .ts  for regular TypeScript
  - .cts for CommonJS modules
  - .mts for ES modules

Official documentation on supported file extensions:
https://www.typescriptlang.org/docs/handbook/esm-node.html#new-file-extensions
2023-03-24 13:13:01 -05:00
Juan C. Müller
6acd200028
Fix spelling of diagnostics (#6418) 2023-03-24 11:26:41 +09:00
Sebastian Zivota
e399bbc379
dracula theme: style wrap indicator like whitespace (#6414) 2023-03-23 11:36:10 -05:00
Aleksey Kuznetsov
2904a10fb1
Add xib and storyboard file types (#6407) 2023-03-22 12:30:33 -05:00
Pascal Kuthe
f9a25a7e09 detailed snippet tests 2023-03-22 14:33:08 +09:00
Pascal Kuthe
85c9dbf603 accept bracket snippet variables without default 2023-03-22 14:33:08 +09:00
Pascal Kuthe
47420db516 accept empty snippet regex replace elements 2023-03-22 14:33:08 +09:00
Pascal Kuthe
617f09adc4 fix single-char variable names 2023-03-22 14:33:08 +09:00
Pascal Kuthe
cabb746b7d do not fail snippet parsing when control chars are not explicitly escaped 2023-03-22 14:33:08 +09:00
dependabot[bot]
52ced7e85f
build(deps): bump bitflags from 1.3.2 to 2.0.2 (#6387)
* build(deps): bump bitflags from 1.3.2 to 2.0.2

Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.3.2 to 2.0.2.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/1.3.2...2.0.2)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* deps: Resolve bitflags 2.0 breaking changes

Bitflags 2.0 release made some breaking changes requiring some small
changes to the Helix codebase.

Almost all of the necessary changes are to manually `#[derive(..)]`
trait implementations which are no longer automatically derived for
all bitflags. All of these were previously automatically derived:

    #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy]

I have derived the minimum traits for each bitflag type.

The other change was to the `.bits` field. This is now a `.bits()`
method so the usage of this has been updated in the `Borders` type.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-03-22 08:12:08 +08:00
Francesc Elies
05ee673197
Show diagnostic codes for LSP diagnostics (#6378)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-03-21 17:15:01 -05:00
Thor Adam
346ddd4735
Add switch_statement to ecma indents (#6369) 2023-03-21 17:13:32 -05:00
zetashift
0e0c16e6fa
Add initial Smithy support (#6370) 2023-03-21 17:12:24 -05:00
Kristoffer Flottorp
b0ceac608e
fleet-dark improvements (#6375)
Co-authored-by: krfl <kr.fl@outlook.com>
2023-03-21 12:59:43 -05:00
dependabot[bot]
6d5fa2045a
build(deps): bump serde from 1.0.152 to 1.0.158 (#6386)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.152 to 1.0.158.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.152...v1.0.158)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 19:20:11 -05:00
dependabot[bot]
68cfc1d6ae
build(deps): bump futures-executor from 0.3.26 to 0.3.27 (#6388)
Bumps [futures-executor](https://github.com/rust-lang/futures-rs) from 0.3.26 to 0.3.27.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.26...0.3.27)

---
updated-dependencies:
- dependency-name: futures-executor
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 19:18:41 -05:00
dependabot[bot]
2f4eac28e5
build(deps): bump indoc from 1.0.9 to 2.0.1 (#6385)
Bumps [indoc](https://github.com/dtolnay/indoc) from 1.0.9 to 2.0.1.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.9...2.0.1)

---
updated-dependencies:
- dependency-name: indoc
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 19:14:29 -05:00
sarah
28632c6cee
Run shell commands asynchronously (#6373) 2023-03-20 19:12:18 -05:00
not
9eb11214b1
theme(rose-pine): add inlay hints (#6384)
* add `ui.virtual.inlay-hint`

* normalise line endings
2023-03-20 18:59:06 -05:00
Gautam Panchal
3da63fa481
Add instructions for installing via AppImage (#6368) 2023-03-20 18:36:27 -05:00
Skyler Hawthorne
4bdeb9927b migrate test_with_config to use AppBuilder 2023-03-20 18:34:40 -05:00
Skyler Hawthorne
d3b051d28e fix test::plain
test::plain uses char indices when it should use byte indices
2023-03-20 18:34:40 -05:00
Skyler Hawthorne
58ea193054 Allow explicit newlines in test DSL
The current test DSL currently has no way to express being at the end of
a line, save for putting an explicit LF or CRLF inside the `#[|]#`. The
problem with this approach is that it can add unintended extra new lines
if used in conjunction with raw strings, which insert newlines for you.

This is a simple attempt to mitigate this problem. If there is an
explicit newline character at the end of the selection, and then it
is immediately followed by the same newline character at the right end
of the selection, this following newline is removed. This way, one can
express a cursor at the end of a line explicitly.
2023-03-20 18:34:40 -05:00
Skyler Hawthorne
a264faa98d refactor test editor config 2023-03-20 18:34:40 -05:00
Skyler Hawthorne
1db252913b print doc state during tests 2023-03-20 18:34:40 -05:00
Skyler Hawthorne
5b07ce76fc make TestCase::From more generic 2023-03-20 18:34:40 -05:00
Skyler Hawthorne
8c5ec95ac0 factor write command tests to own module 2023-03-20 18:34:40 -05:00
pithlessly
78613ac0f2
Disable auto-pairing ' by default in OCaml (#6381)
Since OCaml uses 'a syntax for type variables, the editor shouldn't insert a
second ', for the same reason as Rust.
2023-03-20 12:51:26 -05:00
varon
05e7862e8f
Update nord with inlay-hints (#6376) 2023-03-21 00:11:01 +09:00
Aaron Bull Schaefer
203cf1a919
Document ui.highlight theme key (#6372)
This scope was added via bf5b9a9f35
2023-03-20 21:55:48 +08:00
exp80
770496511c
Fix highlighting in picker with multiple columns (#6333) 2023-03-18 11:16:40 -05:00
angelodlfrtr
ac2a7731a6
Add language support for Cap’n Proto format (#6325) 2023-03-18 09:17:02 -05:00
Sora
9f5374bf47
Update tokyo-night with inlay-hints (#6349) 2023-03-18 11:56:20 +09:00
Yutaro Ohno
bd473928ae
theme: update adwaita-dark for bufferline (#6342)
The adwaita-dark theme has no distinction between active and inactive
buffers on a bufferline. Add contrast to clarify differences.
2023-03-17 12:12:23 -05:00
VuiMuich
a07655d55b
Update Serika themes for inlay-hints (#6344) 2023-03-17 09:53:06 -05:00
Erasin Wang
b20cf15eef
Update queries for makefile (#6339)
- update variable and ref as paramter
- add target as constant
- add inject for shell_text
2023-03-17 09:48:57 -05:00
Ivan Tham
21a3fb8f29
Update ayu theme for inlay-hint (#6329)
Based on vscode ayu badge.
2023-03-16 09:14:23 -05:00
Pascal Kuthe
63c23d4bb0 fix typo
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-03-16 15:46:08 +09:00