Commit Graph

212 Commits (ae105812d6c7ec20220d78d453f614438fbc5ba4)

Author SHA1 Message Date
Brian Dawn ae105812d6 Apply suggestions from code review
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2021-06-06 10:49:17 +09:00
Brian Dawn 255598a2cb Make rust-embed optionally included based on the embed_runtime feature. 2021-06-06 10:49:17 +09:00
Brian Dawn 62d181de78 Provide a feature flag to be able to embed the runtime folder.
These changes provide a new feature flag "embed_runtime" that when
enabled and built in release mode will embed the runtime folder into the
resulting binary.
2021-06-06 10:49:17 +09:00
ahkrr 444cd0b068 fix: make find_prev_char and till_prev_char work
Bevore this PR `commands::find_prev_char` and `commands::till_prev_char` were triggerable through keys 
but `seach::find_nth_next()` was hardcoded in `_find_char`. 
The passed `fn` was nerver used. With this PR the passed `fn` is used.
The change in search.rs resolves an off by one error in the behivor of `find_nth_prev`
2021-06-06 00:01:16 +09:00
Ivan Tham 6254720f53
Add unreachable context
Better error for #123
2021-06-05 20:18:27 +08:00
notoria 2bb71a829e
Don't panic on empty file/buffer (#108) 2021-06-05 13:00:43 +09:00
Kirawi c17dcb8633
Fixing Multiple Panics (#121)
* init

* wip

* wip
2021-06-05 12:49:19 +09:00
Blaž Hrastnik 06d8d3f55f Try to detect language when document file path is set
Fixes #91
2021-06-04 11:03:40 +09:00
notoria 8af5a9a5cf Remove swapfile 2021-06-04 10:30:14 +09:00
notoria f76f44c8af Convert byte index to char index for `find` 2021-06-04 10:00:22 +09:00
Blaž Hrastnik 74e4ac8d49
Merge pull request #77 from notoria/match_brackets
Fix match_brackets::find
2021-06-03 22:13:48 +09:00
notoria 4fe654cf9a Fix match_brackets::find 2021-06-03 10:35:17 +02:00
Ivan Tham d664d1dec0 Default log file to cache 2021-06-03 10:15:17 +08:00
Ivan Tham f5f46b1fed Separate document history into Cell
As history is used separately from the rest of the edits, separating it
can avoid needless borrowing and cloning. But one need to be aware later.
2021-06-02 23:47:50 +08:00
Blaž Hrastnik f4560cb68a Better fix for w/e that also covers `ia<esc>we`/`ia<esc>wb` 2021-06-02 14:57:43 +09:00
Blaž Hrastnik 0851110d10 f/t: Check if at bounds before searching, refs #43, closes #37 2021-06-02 13:20:27 +09:00
Blaž Hrastnik 3ace581191 Fix panics when triggering w or e on the last char of the line
Closes #32
2021-06-02 13:19:40 +09:00
Blaž Hrastnik c0264b9f7f fix: Don't allow moving past last line, fixes #30, #24
Off by 1 error
2021-06-02 13:19:40 +09:00
Blaž Hrastnik 2cc30cd07c Categorize _ as a word char, not punctuation 2021-05-31 21:09:17 +09:00
Blaž Hrastnik 17e9386388 Allow moving to EOL byte, also fixes #15 2021-05-31 17:08:19 +09:00
Blaž Hrastnik 138787f76e Drop clap for pico-args
We barely have any flags so it's not worth the compilation time or
binary size to use clap.
2021-05-31 17:07:43 +09:00
Blaž Hrastnik 6460501a44 Update architecture.md 2021-05-30 17:52:46 +09:00
Blaž Hrastnik 094203c74e Update deps, introduce the new tree-sitter lifetimes 2021-05-28 00:00:51 +09:00
Blaž Hrastnik 0e5b421646 When calculating a new selection, we need to take newly inserted text into account. 2021-05-15 10:50:36 +09:00
Blaž Hrastnik 4a9d1163e0 Hacky way to specify indent scopes per language via toml configs.
Can't do it via a scm query nicely because it returns an iterator over
all the matches, whereas we want to traverse the tree ourselves.

Can't extract the pattern data from a parsed query either.

Oh well, toml files for now.
2021-05-14 19:21:46 +09:00
Blaž Hrastnik 5cbb4efa6d Add the LICENSE file. 2021-05-11 01:44:00 +09:00
Blaž Hrastnik 0190fee1c2 Fix indent test, we need to use the in-tree runtime dir. 2021-05-10 17:57:17 +09:00
Blaž Hrastnik cd1754f783 Fix runtime dir lookup. 2021-05-10 17:37:04 +09:00
Blaž Hrastnik 1f2d87cb95 Make the config dir locator work on Windows. 2021-05-10 16:21:55 +09:00
Blaž Hrastnik 0f77f543e5 Determine runtime dir based on executable location or env override. 2021-05-10 01:02:53 +09:00
Blaž Hrastnik 5954dafdbc Indent array and tuple lists too. 2021-05-09 19:02:35 +09:00
Blaž Hrastnik 6c705f09e8 Lint 2021-05-09 17:13:59 +09:00
Blaž Hrastnik 7c915dc065 Add the :new command, don't crash if saving without filename. 2021-05-07 14:19:58 +09:00
Blaž Hrastnik f8844c6811 Implement pair expansion when pressing new line between bracket pairs.
From:
{|}

To:
{
    |
}
2021-05-06 23:02:32 +09:00
Blaž Hrastnik fd4fd12fa3 clippy lint 2021-05-06 17:20:00 +09:00
Blaž Hrastnik 28c167d71d doc: Be smarter about calculating modified status.
This way edit -> undo will properly show up as unmodified.
2021-05-03 17:23:11 +09:00
Blaž Hrastnik 7e9ea30a0b auto_pairs: move if cursor, extend if selection. 2021-04-22 23:26:57 +09:00
Blaž Hrastnik 5edb374237 And some more indent patterns. 2021-04-14 17:14:13 +09:00
Blaž Hrastnik 9e6c8c2a5a Rust: add a few more scopes to indent. 2021-04-14 15:39:31 +09:00
Blaž Hrastnik 9445b24b88 Simplify calculate_indentation. 2021-04-14 14:28:31 +09:00
Blaž Hrastnik 95dd55ba94 Fix overlap calculation. 2021-04-10 12:02:23 +09:00
Blaž Hrastnik 73f4abbb37 N as extend with search (for now, N should be search_prev). 2021-04-10 00:21:13 +09:00
Blaž Hrastnik 35b4fe4cd0 Fix range.overlap() 2021-04-10 00:20:12 +09:00
Blaž Hrastnik c1e5733b02 Remove the path specifier. 2021-04-09 18:57:46 +09:00
Blaž Hrastnik 71c06c11cb Import tree sitter queries. 2021-04-08 23:25:35 +09:00
Blaž Hrastnik bc4e54c0c4 Load config files from ~/.config/helix, fallback to defaults. 2021-04-07 23:56:20 +09:00
Blaž Hrastnik f0d49d3ca4 hack: make queries load relative to source dir for now.
We want to provide a runtime dir later on.
2021-04-07 18:05:59 +09:00
Blaž Hrastnik e8298a398c Fix selection rendering, it would be off by 1 if reverse. 2021-04-07 16:57:58 +09:00
Blaž Hrastnik 63e602bda6 Fix issues with "enum A {|}" <Enter> indent calculation. 2021-04-07 16:39:13 +09:00
Blaž Hrastnik 9dfd6f6bbc clippy lint 2021-04-06 20:00:35 +09:00