Skip to content

Commit

Permalink
fix: use doc id instead of view id
Browse files Browse the repository at this point in the history
Revert "Merge branch 'upstream/master' into new-daily-driver"

This reverts commit 01972ed, reversing
changes made to a1260d4.
  • Loading branch information
SoraTenshi committed Sep 6, 2024
1 parent 01972ed commit 18555e7
Show file tree
Hide file tree
Showing 141 changed files with 909 additions and 13,350 deletions.
461 changes: 239 additions & 222 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ members = [
"helix-view",
"helix-term",
"helix-tui",
"helix-lsp-types",
"helix-lsp",
"helix-event",
"helix-dap",
Expand Down
462 changes: 229 additions & 233 deletions book/src/generated/lang-support.md

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions book/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ Note that:
## Pre-built binaries

Download pre-built binaries from the [GitHub Releases page](https://github.com/helix-editor/helix/releases).
The tarball contents include an `hx` binary and a `runtime` directory.
To set up Helix:
Add the `hx` binary to your system's `$PATH` to use it from the command line, and copy the `runtime` directory into the config directory (for example `~/.config/helix/runtime` on Linux/macOS).
The runtime location can be overriden via the HELIX_RUNTIME environment variable.

1. Add the `hx` binary to your system's `$PATH` to allow it to be used from the command line.
2. Copy the `runtime` directory to a location that `hx` searches for runtime files. A typical location on Linux/macOS is `~/.config/helix/runtime`.

To see the runtime directories that `hx` searches, run `hx --health`. If necessary, you can override the default runtime location by setting the `HELIX_RUNTIME` environment variable.
12 changes: 4 additions & 8 deletions book/src/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,10 @@ Displays documentation for item under cursor. Remapping currently not supported.

Displays documentation for the selected completion item. Remapping currently not supported.

| Key | Description |
| ---- | ----------- |
| `Shift-Tab`, `Ctrl-p`, `Up` | Previous entry |
| `Tab`, `Ctrl-n`, `Down` | Next entry |
| `Enter` | Close menu and accept completion |
| `Ctrl-c` | Close menu and reject completion |

Any other keypresses result in the completion being accepted.
| Key | Description |
| ---- | ----------- |
| `Shift-Tab`, `Ctrl-p`, `Up` | Previous entry |
| `Tab`, `Ctrl-n`, `Down` | Next entry |

##### Signature-help Popup

Expand Down
19 changes: 2 additions & 17 deletions book/src/remapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,5 @@ Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes

Keys can be disabled by binding them to the `no_op` command.

## Commands

There are three kinds of commands that can be used in keymaps:

* Static commands: commands like `move_char_right` which are usually bound to
keys and used for movement and editing. A list of static commands is
available in the [Keymap](./keymap.html) documentation and in the source code
in [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs)
at the invocation of `static_commands!` macro and the `TypableCommandList`.
* Typable commands: commands that can be executed from command mode (`:`), for
example `:write!`. See the [Commands](./commands.html) documentation for a
list of available typeable commands.
* Macros: sequences of keys that are executed in order. These keybindings
start with `@` and then list any number of keys to be executed. For example
`@miw` can be used to select the surrounding word. For now, macro keybindings
are not allowed in keybinding sequences due to limitations in the way that
command sequences are executed.
A list of commands is available in the [Keymap](https://docs.helix-editor.com/keymap.html) documentation
and in the source code at [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs) at the invocation of `static_commands!` macro and the `TypableCommandList`.
5 changes: 2 additions & 3 deletions book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,8 @@ These scopes are used for theming the editor interface:
| `ui.bufferline.marker` | Style for bufferline underflow and overflow markers |
| `ui.popup` | Documentation popups (e.g. Space + k) |
| `ui.popup.info` | Prompt for multiple key options |
| `ui.picker.header` | Header row area in pickers with multiple columns |
| `ui.picker.header.column` | Column names in pickers with multiple columns |
| `ui.picker.header.column.active` | The column name in pickers with multiple columns where the cursor is entering into. |
| `ui.picker.header` | Column names in pickers with multiple columns |
| `ui.picker.header.active` | The column name in pickers with multiple columns where the cursor is entering into. |
| `ui.window` | Borderlines separating splits |
| `ui.help` | Description box for commands |
| `ui.text` | Default text style, command prompts, popup text, etc. |
Expand Down
8 changes: 2 additions & 6 deletions contrib/completion/hx.nu
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@
# so it has not been specified here and will not be proposed in the autocompletion of Nushell.
# The help message won't be overriden though, so it will still be present here

def health_categories [] {
let languages = ^hx --health languages | detect columns | get Language | filter { $in != null }
let completions = [ "all", "clipboard", "languages" ] | append $languages
return $completions
}
def health_categories [] { ["all", "clipboard", "languages"] }

def grammar_categories [] { ["fetch", "build"] }

# A post-modern text editor.
export extern hx [
--help(-h), # Prints help information
--tutor, # Loads the tutorial
--health: string@health_categories, # Checks for potential errors in editor setup
--health: string@health_categories = "all", # Checks for potential errors in editor setup
--grammar(-g): string@grammar_categories, # Fetches or builds tree-sitter grammars listed in `languages.toml`
--config(-c): glob, # Specifies a file to use for configuration
-v, # Increases logging verbosity each use for up to 3 times
Expand Down
4 changes: 0 additions & 4 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ Existing tests can be used as examples. Helpers can be found in
[helpers.rs][helpers.rs]. The log level can be set with the `HELIX_LOG_LEVEL`
environment variable, e.g. `HELIX_LOG_LEVEL=debug cargo integration-test`.

Contributors using MacOS might encounter `Too many open files (os error 24)`
failures while running integration tests. This can be resolved by increasing
the default value (e.g. to `10240` from `256`) by running `ulimit -n 10240`.

## Minimum Stable Rust Version (MSRV) Policy

Helix follows the MSRV of Firefox.
Expand Down
19 changes: 9 additions & 10 deletions docs/architecture.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@

| Crate | Description |
| ----------- | ----------- |
| helix-core | Core editing primitives, functional. |
| helix-lsp | Language server client |
| helix-lsp-types | Language Server Protocol type definitions |
| helix-dap | Debug Adapter Protocol (DAP) client |
| helix-loader | Functions for building, fetching, and loading external resources |
| helix-view | UI abstractions for use in backends, imperative shell. |
| helix-term | Terminal UI |
| helix-tui | TUI primitives, forked from tui-rs, inspired by Cursive |
| Crate | Description |
| ----------- | ----------- |
| helix-core | Core editing primitives, functional. |
| helix-lsp | Language server client |
| helix-dap | Debug Adapter Protocol (DAP) client |
| helix-loader | Functions for building, fetching, and loading external resources |
| helix-view | UI abstractions for use in backends, imperative shell. |
| helix-term | Terminal UI |
| helix-tui | TUI primitives, forked from tui-rs, inspired by Cursive |


This document contains a high-level overview of Helix internals.
Expand Down
2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
# 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];
nativeBuildInputs = [pkgs.installShellFiles];
# disable tests
doCheck = false;
meta.mainProgram = "hx";
Expand All @@ -142,7 +141,6 @@
cp contrib/Helix.desktop $out/share/applications
cp logo.svg $out/share/icons/hicolor/scalable/apps/helix.svg
cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
installShellCompletion contrib/completion/hx.{bash,fish,zsh}
'';
});
helix = makeOverridableHelix self.packages.${system}.helix-unwrapped {};
Expand Down
9 changes: 2 additions & 7 deletions helix-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ ropey = { version = "1.6.1", default-features = false, features = ["simd"] }
smallvec = "1.13"
smartstring = "1.0.1"
unicode-segmentation = "1.11"
# unicode-width is changing width definitions
# that both break our logic and disagree with common
# width definitions in terminals, we need to replace it.
# For now lets lock the version to avoid rendering glitches
# when installing without `--locked`
unicode-width = "=0.1.12"
unicode-width = "0.1"
unicode-general-category = "0.6"
slotmap.workspace = true
tree-sitter.workspace = true
Expand All @@ -46,7 +41,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"

imara-diff = "0.1.7"
imara-diff = "0.1.6"

encoding_rs = "0.8"

Expand Down
4 changes: 2 additions & 2 deletions helix-core/src/auto_pairs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ impl From<(&char, &char)> for Pair {

impl AutoPairs {
/// Make a new AutoPairs set with the given pairs and default conditions.
pub fn new<'a, V, A>(pairs: V) -> Self
pub fn new<'a, V: 'a, A>(pairs: V) -> Self
where
V: IntoIterator<Item = A> + 'a,
V: IntoIterator<Item = A>,
A: Into<Pair>,
{
let mut auto_pairs = HashMap::new();
Expand Down
9 changes: 4 additions & 5 deletions helix-core/src/indent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ fn is_first_in_line(node: Node, text: RopeSlice, new_line_byte_pos: Option<usize
/// This is usually constructed in one of 2 ways:
/// - Successively add indent captures to get the (added) indent from a single line
/// - Successively add the indent results for each line
/// The string that this indentation defines starts with the string contained in the align field (unless it is None), followed by:
/// The string that this indentation defines starts with the string contained in the align field (unless it is None), followed by:
/// - max(0, indent - outdent) tabs, if tabs are used for indentation
/// - max(0, indent - outdent)*indent_width spaces, if spaces are used for indentation
#[derive(Default, Debug, PartialEq, Eq, Clone)]
Expand Down Expand Up @@ -457,7 +457,7 @@ fn query_indents<'a>(
// Skip matches where not all custom predicates are fulfilled
if !query.general_predicates(m.pattern_index).iter().all(|pred| {
match pred.operator.as_ref() {
"not-kind-eq?" => match (pred.args.first(), pred.args.get(1)) {
"not-kind-eq?" => match (pred.args.get(0), pred.args.get(1)) {
(
Some(QueryPredicateArg::Capture(capture_idx)),
Some(QueryPredicateArg::String(kind)),
Expand All @@ -473,7 +473,7 @@ fn query_indents<'a>(
}
},
"same-line?" | "not-same-line?" => {
match (pred.args.first(), pred.args.get(1)) {
match (pred.args.get(0), pred.args.get(1)) {
(
Some(QueryPredicateArg::Capture(capt1)),
Some(QueryPredicateArg::Capture(capt2))
Expand All @@ -495,7 +495,7 @@ fn query_indents<'a>(
}
}
}
"one-line?" | "not-one-line?" => match pred.args.first() {
"one-line?" | "not-one-line?" => match pred.args.get(0) {
Some(QueryPredicateArg::Capture(capture_idx)) => {
let node = m.nodes_for_capture_index(*capture_idx).next();

Expand Down Expand Up @@ -786,7 +786,6 @@ fn init_indent_query<'a, 'b>(
/// - The line after the node. This is defined by:
/// - The scope `tail`.
/// - The scope `all` if this node is not the first node on its line.
///
/// Intuitively, `all` applies to everything contained in this node while `tail` applies to everything except for the first line of the node.
/// The indents from different nodes for the same line are then combined.
/// The result [Indentation] is simply the sum of the [Indentation] for all lines.
Expand Down
Loading

0 comments on commit 18555e7

Please sign in to comment.