Helix Mirror
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
Blaž Hrastnik 9821c4dd3b Optimize Changeset::is_empty()
Checked the ASM output for these three options:

pub enum Operation {
    /// Move cursor by n characters.
    Retain(usize),
    /// Delete n characters.
    Delete(usize),
    /// Insert text at position.
    Insert(String),
}

pub struct A {
    changes: Vec<Operation>,
    len: usize,
}

impl A {
    pub fn is_empty1(&self) -> bool {
        match self.changes.as_slice() {
            [] => true,
            [Operation::Retain(_)] => true,
            _ => false,
        }
    }

    /// `true` when the set is empty.
    pub fn is_empty2(&self) -> bool {
        let len = self.changes.len();
        len == 0
        || (
            len == 1
            && self.changes[0] == Operation::Retain(self.len)
        )

    }

    pub fn is_empty3(&self) -> bool {
        match self.changes.as_slice() {
            [] | [Operation::Retain(_)] => true,
            _ => false
        }
    }

}
4 years ago
.github/workflows Checkout submodules on clone. 4 years ago
doc deps update 4 years ago
helix-core Optimize Changeset::is_empty() 4 years ago
helix-lsp Adjust LSP changeset generation too: insert now always preceedes delete. 4 years ago
helix-syntax syntax: Stop compiling haskell, seems unmaintained and slowest to compile 4 years ago
helix-term search: Barebones implementation. 4 years ago
helix-view Parse input counts: 10w, etc. 4 years ago
.envrc Add a nix flake with the development environment. 4 years ago
.gitignore Add a nix flake with the development environment. 4 years ago
.gitmodules More robust syntax detection/grammar loading. 4 years ago
Cargo.lock deps update 4 years ago
Cargo.toml wip 4 years ago
README.md deps update 4 years ago
TODO.md Finally: Retain horizontal position when moving vertically. 4 years ago
flake.lock flake: Update deps. 4 years ago
flake.nix deps update 4 years ago
shell.nix Update flake definition. 4 years ago

README.md

Helix

Crate Description
helix-core Core editing primitives, functional.
helix-syntax Tree-sitter grammars
helix-view UI abstractions for use in backends, imperative shell.
helix-term Terminal UI

Installation

git clone --depth 1 --recurse-submodules -j8 https://github.com/helix-editor/helix
cd helix
cargo install --path helix-term

This will install the hx binary to $HOME/.cargo/bin.