Skip to content

Commit

Permalink
Merge branch 'helix-editor:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vesdev authored Dec 16, 2023
2 parents 09b7f88 + c56cd6e commit 3d53c0f
Show file tree
Hide file tree
Showing 31 changed files with 856 additions and 243 deletions.
178 changes: 85 additions & 93 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Its settings will be merged with the configuration directory `config.toml` and t
| `workspace-lsp-roots` | Directories relative to the workspace root that are treated as LSP roots. Should only be set in `.helix/config.toml` | `[]` |
| `default-line-ending` | The line ending to use for new documents. Can be `native`, `lf`, `crlf`, `ff`, `cr` or `nel`. `native` uses the platform's native line ending (`crlf` on Windows, otherwise `lf`). | `native` |
| `insert-final-newline` | Whether to automatically insert a trailing line-ending on write if missing | `true` |
| `indent-heuristic` | How the indentation for a newly inserted line is computed: `simple` just copies the indentation level from the previous line, `tree-sitter` computes the indentation based on the syntax tree and `hybrid` combines both approaches. If the chosen heuristic is not available, a different one will be used as a fallback (the fallback order being `hybrid` -> `tree-sitter` -> `simple`). | `hybrid`

### `[editor.statusline]` Section

Expand Down
2 changes: 2 additions & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP |
| --- | --- | --- | --- | --- |
| agda || | | |
| astro || | | |
| awk ||| | `awk-language-server` |
| bash |||| `bash-language-server` |
Expand Down Expand Up @@ -73,6 +74,7 @@
| idris | | | | `idris2-lsp` |
| iex || | | |
| ini || | | |
| janet || | | |
| java |||| `jdtls` |
| javascript |||| `typescript-language-server` |
| jinja || | | |
Expand Down
2 changes: 1 addition & 1 deletion book/src/generated/typable-cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| `:write-buffer-close!`, `:wbc!` | Force write changes to disk creating necessary subdirectories and closes the buffer. Accepts an optional path (:write-buffer-close! some/path.txt) |
| `:new`, `:n` | Create a new scratch buffer. |
| `:format`, `:fmt` | Format the file using the LSP formatter. |
| `:indent-style` | Set the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.) |
| `:indent-style` | Set the indentation style for editing. ('t' for tabs or 1-16 for number of spaces.) |
| `:line-ending` | Set the document's default line ending. Options: crlf, lf. |
| `:earlier`, `:ear` | Jump back to an earlier point in edit history. Accepts a number of steps or a time span. |
| `:later`, `:lat` | Jump to a later point in edit history. Accepts a number of steps or a time span. |
Expand Down
2 changes: 2 additions & 0 deletions book/src/guides/adding_languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ below.
3. Refer to the
[tree-sitter website](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries)
for more information on writing queries.
4. A list of highlight captures can be found [on the themes page](https://docs.helix-editor.com/themes.html#scopes).

> 💡 In Helix, the first matching query takes precedence when evaluating
> queries, which is different from other editors such as Neovim where the last
Expand All @@ -51,3 +52,4 @@ below.
grammars.
- If a parser is causing a segfault, or you want to remove it, make sure to
remove the compiled parser located at `runtime/grammars/<name>.so`.
- If you are attempting to add queries and Helix is unable to locate them, ensure that the environment variable `HELIX_RUNTIME` is set to the location of the `runtime` folder you're developing in.
9 changes: 9 additions & 0 deletions book/src/guides/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ Note that it matters where these added indents begin. For example,
multiple indent level increases that start on the same line only increase
the total indent level by 1. See [Capture types](#capture-types).

By default, Helix uses the `hybrid` indentation heuristic. This means that
indent queries are not used to compute the expected absolute indentation of a
line but rather the expected difference in indentation between the new and an
already existing line. This difference is then added to the actual indentation
of the already existing line. Since this makes errors in the indent queries
harder to find, it is recommended to disable it when testing via
`:set indent-heuristic tree-sitter`. The rest of this guide assumes that
the `tree-sitter` heuristic is used.

## Indent queries

When Helix is inserting a new line through `o`, `O`, or `<ret>`, to determine
Expand Down
2 changes: 1 addition & 1 deletion book/src/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
## Normal mode

Normal mode is the default mode when you launch helix. Return to it from other modes by typing `Escape`.
Normal mode is the default mode when you launch helix. You can return to it from other modes by pressing the `Escape` key.

### Movement

Expand Down
24 changes: 12 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLibMSRV = (crane.mkLib pkgs).overrideToolchain rustToolchain;
craneLibStable = (crane.mkLib pkgs).overrideToolchain pkgs.pkgsBuildHost.rust-bin.stable.latest.default;
commonArgs =
{
inherit stdenv;
src = filteredSource;
# disable fetching and building of tree-sitter grammars in the helix-term build.rs
HELIX_DISABLE_AUTO_GRAMMAR_BUILD = "1";
buildInputs = [stdenv.cc.cc.lib];
# disable tests
doCheck = false;
meta.mainProgram = "hx";
}
// craneLibMSRV.crateNameFromCargoToml {cargoToml = ./helix-term/Cargo.toml;};
commonArgs = {
inherit stdenv;
inherit (craneLibMSRV.crateNameFromCargoToml {cargoToml = ./helix-term/Cargo.toml;}) pname;
inherit (craneLibMSRV.crateNameFromCargoToml {cargoToml = ./Cargo.toml;}) version;
src = filteredSource;
# disable fetching and building of tree-sitter grammars in the helix-term build.rs
HELIX_DISABLE_AUTO_GRAMMAR_BUILD = "1";
buildInputs = [stdenv.cc.cc.lib];
# disable tests
doCheck = false;
meta.mainProgram = "hx";
};
cargoArtifacts = craneLibMSRV.buildDepsOnly commonArgs;
in {
packages = {
Expand Down
2 changes: 1 addition & 1 deletion helix-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ unicode-general-category = "0.6"
# slab = "0.4.2"
slotmap = "1.0"
tree-sitter.workspace = true
once_cell = "1.18"
once_cell = "1.19"
arc-swap = "1"
regex = "1"
bitflags = "2.4"
Expand Down
Loading

0 comments on commit 3d53c0f

Please sign in to comment.