Commit Graph

4305 Commits (d3b051d28ea62c313fc72583d04f2a897e8d6f40)
 

Author SHA1 Message Date
Daniel S Poulin 6929a12f29
Make `m` textobject look for pairs enclosing selections (#3344)
* Make `m` textobject look for pairs enclosing selections

Right now, this textobject only looks for pairs that surround the
cursor. This ensures that the pair found encloses each selection, which
is likely to be intuitively what is expected of this textobject.

* Simplification of match code

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* Adjust logic for ensuring surround range encloses selection

Prior, it was missing the case where the start of the selection came
before the opening brace. We also had an off-by-one error where if the
end of the selection was on the closing brace it would not work.

* Refactor to search for the open pair specifically to avoid edge cases

* Adjust wording of autoinfo to reflect new functionality

* Implement tests for surround functionality in new integration style

* Fix handling of skip values

* Fix out of bounds error

* Add `ma` version of tests

* Fix formatting of tests

* Reduce indentation levels for readability, and update comments

* Preserve each selection's direction with enclosing pair surround

* Add test case for multiple cursors resulting in overlap

* Mark known failures as TODO

* Make tests multi-threaded or they fail

* Cargo fmt

* Fix typos in integration test comments

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
lesleyrs af1157f37c
Add exit code to command failed msg (#5898) 2 years ago
Colton Clemmer ea3293b4da
Split modification indicator from file statusline elements (#4731) 2 years ago
ath3 1840d775c8
Added tree-sitter-hosts (#4950) 2 years ago
ath3 189c3c2ddc
Add tree-sitter-passwd (#4959) 2 years ago
Pascal Kuthe 8a3ec443f1
Fix new clippy lints (#5892) 2 years ago
Mike Trinkala 9d73a0d112
Fix the infinite loop when copying the cursor to the top of the file (#5888)
Example:
```
test
testitem
```

Select line 2 with x, then type Alt-C; Helix will go into an infinite
loop. The saturating_sub keeps the head_row and anchor_row pinned at 0,
and a selection is never made since the first line is too short.
2 years ago
Pascal Kuthe 7ebcf4e919
properly handle LSP position encoding (#5711)
* properly handle LSP position encoding

* add debug assertion to Transaction::change

* Apply suggestions from code review

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
Blaž Hrastnik 8a602995fa
Address new clippy lints 2 years ago
Pascal Kuthe e474779c87
bump msrv to 1.63 (#5570)
* bump msrv to 1.63

* resolve new complex type clippy lints
2 years ago
Pascal Kuthe bd14f5a72c
update bug report template (#5872) 2 years ago
Blaž Hrastnik 8e2eab1a6f
Also run build checks on merge queue 2 years ago
zSchoen 882fa11d17
Add `Containerfile` file-type for dockerfile language (#5873) 2 years ago
Clément Delafargue f386ff795d
Check for external file modifications when writing (#5805)
`:write` and other file-saving commands now check the file modification
time before writing to protect against overwriting external changes.

Co-authored-by: Gustavo Noronha Silva <gustavo@noronha.dev.br>
Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com>
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
2 years ago
gavincrawford 00ecc556a8
Fix Go select indenting (#5713)
* Fix Go  indenting

* Fix bracket outdent predicate

* Fix brace indenting (again)
2 years ago
Matthew Toohey 05c5207265
feat: add pem language (#5797) 2 years ago
Surendrajat fce30c0da0
xml: add mobileconfig & plist file types (#5863) 2 years ago
Mike Trinkala c704701714
Short-circuit the word and treesitter object movement commands (#5851)
The loop always iterates the number of times the user specified even
if the beginning/end of the document is reached.

For an extreme demonstration try the following commands, Helix will
hang for several seconds.
100000000w
100000000]c
2 years ago
Michael Davis 23ed8c12f1
Select change range for goto_first/last_change commands (#5206)
This matches the behavior from 42ad1a9e04
but for the first and last change. The selection rules are the same
as for goto_next/prev_change: additions and modifications select the
added and modified range while deletions are represented with a point.
2 years ago
Jesús González f71f27f804
Add Darcula Solid theme (#5778)
* Add Darcula Solid theme.

* Update darcula solid theme.

* Derive darcula-solid theme from original darcula
2 years ago
Kirawi fb149133db
Make `fleet-dark` accurate to the official theme (#5605) 2 years ago
dependabot[bot] 7f6a91fd63
build(deps): bump ropey from 1.5.1 to 1.6.0 (#5859)
Bumps [ropey](https://github.com/cessen/ropey) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/cessen/ropey/releases)
- [Changelog](https://github.com/cessen/ropey/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cessen/ropey/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: ropey
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot] 9b69f5010d
build(deps): bump anyhow from 1.0.68 to 1.0.69 (#5858)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.68 to 1.0.69.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.68...1.0.69)

---
updated-dependencies:
- dependency-name: anyhow
  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>
2 years ago
dependabot[bot] f3f8660d36
build(deps): bump serde_json from 1.0.91 to 1.0.92 (#5857)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.91 to 1.0.92.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.91...v1.0.92)

---
updated-dependencies:
- dependency-name: serde_json
  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>
2 years ago
dependabot[bot] b97462ea9b
build(deps): bump unicode-segmentation from 1.10.0 to 1.10.1 (#5856)
Bumps [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/unicode-rs/unicode-segmentation/releases)
- [Commits](https://github.com/unicode-rs/unicode-segmentation/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: unicode-segmentation
  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>
2 years ago
dependabot[bot] 093b37d7e7
build(deps): bump cachix/install-nix-action from 18 to 19 (#5855)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 18 to 19.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v18...v19)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  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>
2 years ago
Ethan Budd 9c98043c1c
Recognize .C and .H file types as cpp (#5808) 2 years ago
Jaeho Choi 0eba0db4a0
docs: Fix PowerShell runtime linking command (#5822) 2 years ago
Skyler Hawthorne b2e83f81e1
enable rendering in integration tests (#5819)
This will allow testing more of the code base, as well as enable UI-
specific testing.

Debug mode builds are prohibitively slow for the tests, mostly
because of the concurrency write tests. So there is now a profile for
integration tests that sets the optimization level to 2 for a few helix
crates, and lowers the number of rounds of concurrent writes to 1000.
2 years ago
Alex d6e2434f73
Add `ui.virtual.wrap` to theme docs (#5823) 2 years ago
Aleksey Kuznetsov 7b46a6cada
Add Podfile and *.podspec to the file types for ruby (#5811) 2 years ago
William Etheredge f7bd7b5eaf
Add :character-info command (#4000) 2 years ago
Brett Lyons d8f482e11e
Add MSBuild language based on XML grammar (#5793) 2 years ago
LeoniePhiline 30412366be
feat: Update `tree-sitter-sql` and migrate `highlights.scm` to match grammar (#5772)
* Sort buildin functions alphabetically

* fix: Query float type like other numeric types

* Update tree-sitter-sql and update highlights.scm to match grammar
2 years ago
Cemal Okten 10fee815c4
Add Jellybeans theme (#5719) 2 years ago
Pascal Kuthe 350535208f
always commit to history when pasting (#5790) 2 years ago
Skyler Hawthorne a5233cf5ad disable lsp in integration tests 2 years ago
Skyler Hawthorne 06d095f31c provide option to completely disable lsp 2 years ago
Skyler Hawthorne 0e038fb80c make clipboard message debug 2 years ago
Filipe Azevedo 8ba0a46274
add picker: current view dir (#4666) 2 years ago
Dylan Bulfin 61e1e6160a
Removing C-j and C-k from completion menu navigation (#5070) 2 years ago
Pascal Kuthe f0c2e898b4
add substring matching options to picker (#5114) 2 years ago
Gokul Soumya e31943c4c4
Tabulate buffer picker contents (#5777) 2 years ago
Pascal Kuthe 2949bb018c
fix position translation at EOF with softwrap (#5786) 2 years ago
Pascal Kuthe 6ed2348078
Hide duplicate symlinks from the picker (#5658)
* hide duplicate symlinks from the picker

* Apply suggestions from code review

Co-authored-by: g-re-g <123515925+g-re-g@users.noreply.github.com>

* minor stylistic fix

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

---------

Co-authored-by: g-re-g <123515925+g-re-g@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
Mike Trinkala 62d046fa21
Fix utf8 length handling for shellwords (#5738)
If the last argument to shellwords ends in a multibyte utf8 character
the entire argument will be dropped.
e.g. `:sh echo test1 test2𒀀` will only output `test1`

Add additional tests based on the code review feedback
2 years ago
Michael Davis 685cd383a3
Surround with line-endings on `ms<ret>` (#4571)
This change makes `ms<ret>` work similarly to `t<ret>` and related
find commands: when the next event is a keypress of Enter, surround
the selection with the document's line-endings.
2 years ago
Michael Davis d5f17d3f69
Fix initial highlight layer sort order (#5196)
The purpose of this change is to remove the mutable self borrow on
`HighlightIterLayer::sort_key` so that we can sort layers with the
correct ordering using the `Vec::sort` function family.
`HighlightIterLayer::sort_key` needs `&mut self` since it calls
`Peekable::peek` which needs `&mut self`. `Vec::sort` functions
only give immutable borrows of the elements to ensure the
correctness of the sort.

We could instead approach this by creating an eager Peekable and using
that instead of `std::iter::Peekable` to wrap `QueryCaptures`:

```rust
struct EagerPeekable<I: Iterator> {
    iter: I,
    peeked: Option<I::Item>,
}

impl<I: Iterator> EagerPeekable<I> {
    fn new(mut iter: I) -> Self {
        let peeked = iter.next();
        Self { iter, peeked }
    }

    fn peek(&self) -> Option<&I::Item> {
        self.peeked.as_ref()
    }
}

impl<I: Iterator> Iterator for EagerPeekable<I> {
    type Item = I::Item;

    fn next(&mut self) -> Option<Self::Item> {
        std::mem::replace(&mut self.peeked, self.iter.next())
    }
}
```

This would be a cleaner approach (notice how `EagerPeekable::peek`
takes `&self` rather than `&mut self`), however this doesn't work in
practice because the Items emitted by the `tree_sitter::QueryCaptures`
Iterator must be consumed before the next Item is returned.
`Iterator::next` on `tree_sitter::QueryCaptures` modifies the
`QueryMatch` returned by the last call of `next`. This behavior is
not currently reflected in the lifetimes/structure of `QueryCaptures`.

This fixes an issue with layers being out of order when using combined
injections since the old code only checked the first range in the
layer. Layers being out of order could cause missing highlights for
combined-injections content.
2 years ago
gibbz00 b2251870da
Add ayu_evolve theme (#5638)
* Add ayu_evolve theme

* ayu_evolve: fix typo + raw markdown highlight

* Update runtime/themes/ayu_evolve.toml typo

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
Gokul Soumya 0f562dfeab
theme(onedark): Add ui.highlight scope (#5755) 2 years ago