Commit Graph

132 Commits (eea339545cf7198b7a9e477ee2a9ee081ee5be36)

Author SHA1 Message Date
Blaž Hrastnik dd91090a1a Implement keep_selections (filter selections on regex). 3 years ago
Blaž Hrastnik 87e3cd3df2 ui: Render diagnostic errors in sideline. 3 years ago
Blaž Hrastnik 9c55b3e306 state.rs cleanup 3 years ago
Blaž Hrastnik bb87b08fc9 Configure language servers via LanguageConfiguration. 3 years ago
Blaž Hrastnik 1cf887dea9 Cleanup: use doc.selection() instead of doc.state.selection(). 3 years ago
Blaž Hrastnik 3445abf88e syntax: Hide the TSParser internally, borrowing when needed. 3 years ago
Blaž Hrastnik b7dd7310c4 syntax: Reuse parser instances. highlight_iter() no longer needs &mut. 3 years ago
Blaž Hrastnik 9dcfe25e4a Use diagnostic.severity to distinguish between error colors. 3 years ago
Blaž Hrastnik 4acf301022 Implement the f/t/F/T find/till family of commands. 3 years ago
Blaž Hrastnik 62c991230f find-till (f) prototype, on_next_key mode implementation. 3 years ago
Blaž Hrastnik 90f9cd6d62 search: draft f/t 3 years ago
Blaž Hrastnik a16c6e2585 clippy lints 3 years ago
Blaž Hrastnik 2c9b02039b commands: Implement join_selections. 3 years ago
Blaž Hrastnik ad58286dc7 graphemes: fix nth_prev_grapheme_boundary calculation. 3 years ago
Blaž Hrastnik 01907b3497 commands: Implement count for a few more commands. 3 years ago
Blaž Hrastnik 6bd16a7320 graphemes: Optimize nth_next/nth_prev operation.
It's used a lot more than it used to in position calculation. Instead of
throwing away state between boundary calculation, reuse it.
3 years ago
Blaž Hrastnik f118e7580f Improve coords_at_pos & pos_at_coords, test with graphemes. 3 years ago
Blaž Hrastnik 87a6d4e736 minor: Simplify some code. 3 years ago
Blaž Hrastnik 6cfb1acb9d commands: Implement expand_selection. 3 years ago
Blaž Hrastnik 33c67f1388 commands: add * as selection search. 3 years ago
Blaž Hrastnik 9132c6a591 Make some Document fields read-only. 3 years ago
Blaž Hrastnik 8c82f8f140 indent: use_list indentation, fix indentation bug on open_below
use std::{
  time::Duration // <- pressing `o` here would use }'s indent instead of prev line
}
3 years ago
Blaž Hrastnik 7a1ff5e45f commands: Wire up toggle comments as ctrl-c 3 years ago
Blaž Hrastnik 4ab5631d65 more lints 3 years ago
Blaž Hrastnik d0791e0f98 core: Implement comment toggling module. 3 years ago
Blaž Hrastnik c9dd1c930e treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref 3 years ago
Blaž Hrastnik af55ebd002 transaction: Also modify map_pos to work with insert|delete order. 3 years ago
Blaž Hrastnik 9cac44c7c0 minor changes 3 years ago
Blaž Hrastnik d8bc19f715 Update deps, switch tendril over to crates.io 3 years ago
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
        }
    }

}
3 years ago
Blaž Hrastnik b0b5451c38 Since insert preceedes deletes, follow that ordering in Transaction::changes.
Produces the same output but will take the happy path.
3 years ago
Blaž Hrastnik b4312c9492 transaction: Use builder methods to generate compact changesets. 3 years ago
Blaž Hrastnik 19fb4ed835 transaction: Merge consecutive inserts on compose. 3 years ago
Blaž Hrastnik 65893a2cbc fix test 3 years ago
Blaž Hrastnik 239db79834 Finally: Retain horizontal position when moving vertically. 3 years ago
Blaž Hrastnik a924ad2885 simplify. 3 years ago
Blaž Hrastnik 2bea5db7bd commands: Implement select_on_matches. 3 years ago
Blaž Hrastnik 7c99ff58fd nix: include rust-src so rust-analyzer works correctly. 3 years ago
Blaž Hrastnik 22e1692adc indent: Fix edge cases, refactor test. 4 years ago
Blaž Hrastnik 777a80917d Address clippy lints. 4 years ago
Blaž Hrastnik 7d41550a23 indent: refactor logic to be more correct.
Thanks to atom-sane-indentation, nvim-treesitter and tree-sitter-indent.el
for inspiration.
4 years ago
Blaž Hrastnik a7869c728c wip 4 years ago
Blaž Hrastnik cc6bdf8f66 Text change generation, RPC call handling. 4 years ago
Blaž Hrastnik f5981f72c2 Introduce Selection::point. 4 years ago
Blaž Hrastnik efc5aa2016 Simplify old_state handling. 4 years ago
Blaž Hrastnik c0e17dd324 Fix undo/redo not updating the syntax tree. 4 years ago
Blaž Hrastnik b39849dde1 Refactor: Document type as a wrapper around barebones State. 4 years ago
Blaž Hrastnik ef5e5f9296 state.version tracking 4 years ago
Blaž Hrastnik 49254d7180 Total mess but it works: diagnostic marking. 4 years ago
Blaž Hrastnik f9bfba4d96 Reroute LSP notification events into the main app event loop. 4 years ago