Commit Graph

513 Commits

Author SHA1 Message Date
Omnikar
45fadf6151
Add hyperlinks to fix cargo doc warn (#931) 2021-10-29 09:55:15 +09:00
Blaž Hrastnik
f3c7f20dbc Release v0.5.0 2021-10-28 16:41:34 +09:00
Gygaxis Vainhardt
0a38983ee3
Remove three transmutes from helix-core syntax.rs (#923) 2021-10-28 10:24:11 +09:00
Kirawi
92c2d5d3bf
Document more of helix-core (#904) 2021-10-26 01:02:16 +09:00
Blaž Hrastnik
3edca7854e completion: fully revert state before apply & insertText common prefix 2021-10-25 11:09:09 +09:00
Blaž Hrastnik
bfb6cff5a9 fix: Compose where changes.compose(empty_other) 2021-10-25 11:09:09 +09:00
Dmitry Sharshakov
6aa9838ea6
dap: support arrays as arguments 2021-10-24 17:24:18 +03:00
Blaž Hrastnik
cee7ad781e Mark a few functions as const 2021-10-24 17:28:29 +09:00
Kirawi
0cb5e0b2ca
log syntax highlighting init errors (#895) 2021-10-23 21:52:18 +09:00
Gokul Soumya
4ee92cad19
Add treesitter textobjects (#728)
* Add treesitter textobject queries

Only for Go, Python and Rust for now.

* Add tree-sitter textobjects

Only has functions and class objects as of now.

* Fix tests

* Add docs for tree-sitter textobjects

* Add guide for creating new textobject queries

* Add parameter textobject

Only parameter.inside is implemented now, parameter.around
will probably require custom predicates akin to nvim' `make-range`
since we want to select a trailing comma too (a comma will be
an anonymous node and matching against them doesn't work similar
to named nodes)

* Simplify TextObject cell init
2021-10-23 11:41:19 +09:00
Blaž Hrastnik
182a59b552 Update to rust 1.56 + 2021 edition 2021-10-22 12:15:18 +09:00
Michael Davis
1766bdb9d4
clean up combined-injections comment (#880) 2021-10-19 13:08:06 +09:00
Blaž Hrastnik
83a8167402 Invert core -> dap dependency 2021-10-17 13:58:11 +09:00
Blaž Hrastnik
0a6b60085a Merge branch 'master' into debug 2021-10-17 13:51:56 +09:00
Dmitry Sharshakov
48cb81eff1
Merge branch 'master' into debug 2021-10-09 16:03:46 +03:00
Ivan Tham
4260b31ec0
Update mdbook style and fix unreadable table head (#806)
The styles are now pulled from upstream styles, some of the changes I
submitted it back to upstream.

Fix #796
2021-10-09 20:35:27 +09:00
Midnight Exigent
eedcea7e6b
Allow language.config (in languages.toml) to be passed in as a toml object (#807)
* allow language.config (in languages.toml) to be passed in as a toml object

* Change config field for languages from json string to toml object

* remove indents on languages.toml config

* fix: remove patch version from serde_json import in helix-core

* Use same tree-sitter-zig as upstream/master
2021-10-08 11:14:12 +09:00
dependabot[bot]
8925fdd6f3
build(deps): bump smallvec from 1.6.1 to 1.7.0 (#813)
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.6.1...v1.7.0)

---
updated-dependencies:
- dependency-name: smallvec
  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>
2021-10-05 12:18:37 +09:00
dependabot[bot]
97b24fd91e
build(deps): bump similar from 2.0.0 to 2.1.0 (#812)
Bumps [similar](https://github.com/mitsuhiko/similar) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/mitsuhiko/similar/releases)
- [Changelog](https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/similar/compare/2.0.0...2.1.0)

---
updated-dependencies:
- dependency-name: similar
  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>
2021-10-05 12:18:25 +09:00
Dmitry Sharshakov
d943a51e3e
editor: add Node.js debugger 2021-09-26 21:36:06 +03:00
Dmitry Sharshakov
bf53aff27d Merge branch 'master' into debug 2021-09-25 23:14:59 +03:00
Blaž Hrastnik
2e0803c8d9 Implement 'remove_primary_selection' as Alt-,
This allows removing search matches from the selection

Fixes #713
2021-09-24 10:30:28 +09:00
Blaž Hrastnik
64e8f0017c ... 2021-09-16 16:04:32 +09:00
Blaž Hrastnik
d8b94ba85f Fix broken test 2021-09-16 15:54:43 +09:00
Blaž Hrastnik
dd0b15e1f1 syntax: Properly handle injection-regex for language injections 2021-09-16 15:50:14 +09:00
dependabot[bot]
51b7f40da1
build(deps): bump similar from 1.3.0 to 2.0.0 (#754)
Bumps [similar](https://github.com/mitsuhiko/similar) from 1.3.0 to 2.0.0.
- [Release notes](https://github.com/mitsuhiko/similar/releases)
- [Changelog](https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/similar/compare/1.3.0...2.0.0)

---
updated-dependencies:
- dependency-name: similar
  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>
2021-09-14 09:21:35 +09:00
Blaž Hrastnik
066367c0a4 fix: Need to reset set_byte_range in case cursor_ref is reused. 2021-09-13 17:44:57 +09:00
Dmitry Sharshakov
413e477dc2 lldb: use stdio transport by default 2021-09-06 13:49:31 +03:00
Blaž Hrastnik
4ac29434cb syntax: Add go & rust locals, improve tree-sitter error message 2021-09-06 18:13:52 +09:00
Blaž Hrastnik
585e3ce830 fix: tree-sitter-scopes would infinitely loop 2021-09-06 15:25:46 +09:00
Blaž Hrastnik
3cb95be452 Update tree-sitter to 0.20
0.20 includes querying improvements, we no longer have to convert
fragments to strings but can return an iterator of chunks instead.
2021-09-06 13:21:53 +09:00
Blaž Hrastnik
4d24a43651 dap: use smallvec! macro 2021-08-29 23:02:46 +09:00
Blaž Hrastnik
2a7e38a2b4 helix-core doesn't need to import serde_json 2021-08-29 22:33:42 +09:00
Dmitry Sharshakov
b42631942b
Defaults in completions, better schema 2021-08-29 14:51:47 +03:00
Dmitry Sharshakov
e315394631
Merge remote-tracking branch 'origin/master' into debug 2021-08-28 14:59:26 +03:00
Brian Shu
fa4caf7e3d remove unsafe 2021-08-27 09:50:57 +09:00
Yusuf Bera Ertan
dc57f8dc89
feat: merge default languages.toml with user provided languages.toml, add a generic TOML value merge function (#654)
* feat: merge default languages.toml with user provided languages.toml

* refactor: use catch-all to override all other values for merge toml

* tests: add a test case for merging languages configs

* refactor: change test module name
2021-08-27 00:29:14 +09:00
Blaž Hrastnik
68bf9fdf02 Fix tests broken by the State change 2021-08-26 09:26:38 +09:00
Blaž Hrastnik
9d4c301563 Reduce State use a bit further
This is a legacy type that should be fully removed.
2021-08-26 09:21:07 +09:00
Dmitry Sharshakov
2ad2838a27
Fix tests 2021-08-25 19:36:49 +03:00
Dmitry Sharshakov
c7759a5aa0
Merge remote-tracking branch 'origin/master' into debug 2021-08-25 19:22:01 +03:00
Kirawi
b99db7c687
Move path util functions from helix-term to helix-core (#650) 2021-08-25 10:04:05 +09:00
Dmitry Sharshakov
c463142e5e
Create new debugger config format 2021-08-24 11:56:18 +03:00
Dmitry Sharshakov
56d00fa7f4
Fix tests 2021-08-23 18:00:30 +03:00
Dmitry Sharshakov
b6b99b2487
config: minor fixes 2021-08-23 17:26:12 +03:00
Dmitry Sharshakov
f55a012fb7
editor: add debug session config 2021-08-23 16:56:41 +03:00
Dmitry Sharshakov
c5b210df59
Add debug-adapter field to languages.toml 2021-08-23 16:48:06 +03:00
langbamit
36095326d0
Fix auto pairs return wrong selection (#613) 2021-08-19 00:59:53 +09:00
Cor Peters
ac3c1719c9
Fixes crash on empty rust file. (#592)
Fixes #591

Co-authored-by: Cor Peters <luctius@gmail.com>
2021-08-16 19:18:23 +09:00
Blaž Hrastnik
1caedc18ca Release v0.4.1 2021-08-14 13:32:29 +09:00
Blaž Hrastnik
b635e35818 Appease clippy 2021-08-13 13:16:31 +09:00
Blaž Hrastnik
fd1eaafff5 Add :tree-sitter-scopes, useful when developing indents.toml 2021-08-13 13:15:53 +09:00
Blaž Hrastnik
7c834d6506 fix: tree sitter rendering glitches with multiple selection edits 2021-08-13 13:15:53 +09:00
Blaž Hrastnik
3de40de0a9 fix build... 2021-08-13 01:28:11 +09:00
Blaž Hrastnik
733ee06b7b Release v0.4.0 2021-08-13 01:24:04 +09:00
Nathan Vegdahl
b5223618ed Document pos_at_coords better.
Particularly the effect of the `limit_before_line_ending`
parameter.
2021-08-09 11:12:38 +09:00
Nathan Vegdahl
953125d3f3
Fix around-word text-object selection. (#546)
* Fix around-word text-object selection.

* Text object around-word: select to the left if no whitespace on the right.

Also only select around when there's whitespace at all.

* Make select-word-around select all white space on a side.

* Update commented-out test case.

* Fix unused import warning from rebase.
2021-08-06 09:32:33 +09:00
Nathan Vegdahl
c9cbc344fc Fix buggy surround behavior from #376.
Fixes #543.
2021-08-04 09:55:59 +08:00
Blaž Hrastnik
62eb8c6b40 mouse: Remove verify_screen_coords, refactor primary selection modification 2021-07-30 16:52:14 +09:00
Blaž Hrastnik
0fdb626c2c Remove embed_runtime feature
It's no longer practical to maintain. Closes #451
2021-07-30 16:27:22 +09:00
Nathan Vegdahl
f88d4c1e20 Move indent-style code into helix_core::indent. 2021-07-30 12:22:59 +09:00
Nathan Vegdahl
3fda350494 Fixes for new clippy lints in Rust 1.54. 2021-07-29 22:47:18 +02:00
Nathan Vegdahl
cd7302ffd3 Enforce cursor/selection invariants in one place.
Rather than per-command like before.
2021-07-28 15:57:00 -07:00
Nathan Vegdahl
aead4e69a6 Minor cleanup of the vertical movement code. 2021-07-26 23:20:58 -07:00
Nathan Vegdahl
84f8167fd1 Use match for branching on the Direction enum in more places. 2021-07-26 23:09:58 -07:00
Nathan Vegdahl
5229c5387f Add unit tests for some of the new Range methods. 2021-07-26 20:03:12 -07:00
Nathan Vegdahl
b2c76dc627 Improve Range documentation and organization. 2021-07-26 18:04:03 -07:00
Nathan Vegdahl
f62ec6e51e Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-26 11:19:10 -07:00
Nathan Vegdahl
5ee6ba5b38 Address some PR comments. 2021-07-26 10:51:00 -07:00
Nathan Vegdahl
0883b4fae0 Collect some common patterns into methods on Range. 2021-07-26 08:40:30 -07:00
Ivan Tham
f7c8500797 Fix append newline indent
Fix #492
2021-07-26 22:36:40 +09:00
Blaž Hrastnik
63e54e30a7 Implement in-memory prompt history
Implementation is similar to kakoune: we store the entries into
a register.
2021-07-26 11:19:33 +09:00
Omnikar
112ae5cffe
Determine whether to use a margin of 0 or 1 when uncommenting (#476)
* Implement `margin` calculation for uncommenting

* Move `margin` calculation to `find_line_comment`

* Fix comment bug with multiple selections on a line

* Fix `find_line_comment` test for new return type

* Generate a single vec of lines for comment toggle

`toggle_line_comments` collects the lines covered by all selections into
a `Vec`, skipping duplicates. `find_line_comment` now returns the lines
to operate on, instead of returning the lines to skip.

* Fix test for `find_line_comment`

* Reserve length of `to_change` instead of `lines`

The length of `lines` includes blank lines which will be skipped, and as
such do not need space for a change reserved for them. `to_change`
includes only the lines which will be changed.

* Use `token.chars().count()` for token char length

* Create `changes` with capacity instead of reserving

* Remove unnecessary clones in `test_find_line_comment`

* Add test case for 0 margin comments

* Add comments explaining `find_line_comment`
2021-07-26 11:00:58 +09:00
Nathan Vegdahl
f96b8b769b Switch to a cleaner range-head moving abstraction.
Also fix a bunch of bugs related to it.
2021-07-24 07:44:11 -07:00
Nathan Vegdahl
43594049dd Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-23 17:23:16 -07:00
Nathan Vegdahl
ad814b8c2e Fix append mode, and make insertion always happen at head of range. 2021-07-23 14:27:12 -07:00
Nathan Vegdahl
ffb8057a7f Fix ocassional panic when matching brackets. 2021-07-22 18:47:37 -07:00
Nathan Vegdahl
fd684ef693 Revert display-width-based vertical cursor movement.
Still needs to be done, but should be part of a separate PR.
2021-07-22 13:21:44 -07:00
Nathan Vegdahl
5841954f58 Calculate the line that the range head is on correctly. 2021-07-22 11:17:03 -07:00
fossdd
d4bd5b3766 The item fmt was imported redundantly
Fixed warning:

```
warning: the item `fmt` is imported redundantly
  --> helix-core/src/syntax.rs:98:9
   |
16 |     fmt,
   |     --- the item `fmt` is already imported here
...
98 |     use std::fmt;
   |         ^^^^^^^^
   |
```
2021-07-22 22:39:17 +09:00
Nathan Vegdahl
bc85c85501 Fix selections not being modified quite correctly with text edits. 2021-07-21 09:23:01 -07:00
Nathan Vegdahl
c848ed7abc Fixes for misc bugs with view movement. 2021-07-20 18:15:34 -07:00
Nathan Vegdahl
c9300ec35f Fix comment toggle command also sometimes toggling the next line. 2021-07-20 12:23:40 -07:00
Nathan Vegdahl
1c6b5581f0 Fix various bugs related to goto-end-of-line command.
This also fixes a bug with `Selection::normalize()`, that could
result in an out-of-bounds primary index.
2021-07-20 11:58:56 -07:00
Nathan Vegdahl
c400a60377 Fix Selection::push() to make the pushed range primary.
Apparently I accidentally deleted that behavior in the cleanup.
2021-07-19 18:25:36 -07:00
Nathan Vegdahl
e98d669c30 Handle edge case in range_to_target() correctly. 2021-07-19 12:30:08 -07:00
Nathan Vegdahl
b0311f4fc2 Fixed primary cursor position calculation to use 1-width semantics.
This had a bunch of knock-on effects that were buggy, such as bracket
match highlighting.
2021-07-19 09:25:10 -07:00
Nathan Vegdahl
e462f32723 Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-18 22:02:12 -07:00
Nathan Vegdahl
6c038bb015 Update word selection/navigation to work with gap indexing.
Also tweaked some of the existing behavior that seemed inconsistent
and/or buggy.  It's mostly identical, just a few corner cases are
different.
2021-07-18 21:59:31 -07:00
Blaž Hrastnik
bf43fabf65 Remove ExactSizeIterator requirement on Transaction::change
Size hint is enough.
2021-07-19 11:29:51 +09:00
Cor Peters
cd65a48635
Made toggle_comments language dependent (#463)
* Made toggle_comments language dependent

* Fixed Test Cases

* Added clippy suggestion

* Small Fixes

* Clippy Suggestion

Co-authored-by: Cor <prive@corpeters.nl>
2021-07-19 01:33:38 +09:00
Cor Peters
0aa43902ca
Added option to provide a custom config file to the lsp. (#460)
* Added option to provide a custom config file to the lsp.

* Simplified lsp loading routine with anyhow

* Moved config to language.toml

* Fixed test case

* Cargo fmt

* Revert now-useless changes

* Renamed custom_config to config

Co-authored-by: Cor <prive@corpeters.nl>
2021-07-18 16:56:25 +09:00
Nathan Vegdahl
a77274e8bb Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-17 10:49:03 -07:00
Blaž Hrastnik
dd2903ff10 Dynamically load grammar libraries at runtime 2021-07-14 10:00:05 +09:00
Nathan Vegdahl
b4c59b444c Update surround commands to work with gap indexing. 2021-07-08 16:47:20 -07:00
Kirawi
084a8a9522
Rewritten Rust highlights.scm (#425)
* rewrote Rust highlights.scm

* wip

* wip

* wip

* wip

* fixed type highlighting

* wip

* rewrite again

* moved operators

* missing newline

* missing newline

* update book

* fix constructor highlighting

* fix constructor highlighting

* fix const highlighting

* better constructor highlighting

* remove dup, bug was my locals.scm file

* fixed docs

* merge

* fixed for highlighting

* add yield

* remove yield

* added yield back

* fixed yield highlighting

* unecessary
2021-07-09 01:11:20 +09:00
Nathan Vegdahl
753f7f381b Implement Range::put() which manages range movements and extensions.
In particular, this wraps the annoying logic involved in keeping the
cursor width to 1 grapheme.
2021-07-07 17:24:39 -07:00
Nathan Vegdahl
85d5b399de Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-05 20:27:49 -07:00
Nathan Vegdahl
6e15c9b874 Make vertical selection movement work properly. 2021-07-05 18:58:33 -07:00
dependabot[bot]
c8681a820c Bump unicode-segmentation from 1.7.1 to 1.8.0
Bumps [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/unicode-rs/unicode-segmentation/releases)
- [Commits](https://github.com/unicode-rs/unicode-segmentation/compare/1.7.1...v1.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-06 09:52:33 +09:00
Ivan Tham
6ccfa229ed Fix typo on comment in surround 2021-07-03 20:20:24 +08:00
Gokul Soumya
351c1e7e55 Fix surround bug when cursor on same pair
For example when the cursor is _on_ the `'` in `'word'`, the cursor
wouldn't move because the search for a matching pair started _from_ the
position of the cursor and simply found itself.
2021-07-03 20:20:24 +08:00
Gokul Soumya
c68fe1f2a3
Add object selection (textobjects) (#385)
* Add textobjects for word

* Add textobjects for surround characters

* Apply clippy lints

* Remove ThisWordPrevBound in favor of PrevWordEnd

It's the same as PrevWordEnd except for taking the current char
into account, so use a "flag" to capture that usecase

* Add tests for PrevWordEnd movement

* Remove ThisWord* movements

They did not preserve anchor positions and were only used
for textobject boundary search anyway so replace them with
simple position finding functions

* Rewrite tests of word textobject

* Add tests for surround textobject

* Add textobject docs

* Refactor textobject word position functions

* Apply clippy lints on textobject

* Fix overflow error with textobjects
2021-07-03 10:07:49 +09:00
Nathan Vegdahl
28d2d68804 Make horizontal selection movement work properly. 2021-07-02 09:51:29 -07:00
Kirawi
c5b2973739
:reload (#374)
* reloading functionality

* fn with_newline_eof()

* fmt

* wip

* wip

* wip

* wip

* moved to core, added simd feature for encoding_rs

* wip

* rm

* .gitignore

* wip

* local wip

* wip

* wip

* no features

* wip

* nit

* remove simd

* doc

* clippy

* clippy

* address comments

* add indentation & line ending change
2021-07-02 23:54:50 +09:00
Nathan Vegdahl
22dca3b111 Allow last line in file to lack a line break character. 2021-07-01 23:36:09 -07:00
Perry Thompson
e177b27baf Add missing import 2021-07-02 12:10:15 +09:00
Nathan Vegdahl
230248bbc3 Fix a couple additional unused warnings after merge. 2021-07-01 19:40:37 -07:00
Nathan Vegdahl
2224a1527e Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-01 19:37:28 -07:00
Nathan Vegdahl
9f62ad0715 Fixed last unused warning. 2021-07-01 19:06:52 -07:00
Nathan Vegdahl
c389f41f14 Fix one of the two remaining warnings.
One of them was a lot more obvious than I thought.
2021-07-01 19:06:52 -07:00
Nathan Vegdahl
220bc85821 Fix all remaining warnings in helix-core except for two.
I'm not sure how to address them, because they look like they
might be bugs, and code is involved.  Will poke the relevant people.
2021-07-01 19:06:52 -07:00
Nathan Vegdahl
b571f28641 Remove #[allow(unused)] from helix-core, and fix unused imports.
Still a bunch more warnings to fix in core, but it's a start.
2021-07-01 19:06:52 -07:00
Nathan Vegdahl
e725957704 Ensure a minimum selection width on commands that need it. 2021-07-01 14:22:28 -07:00
Nathan Vegdahl
7c7be6d583 Make Selection's normalize and transform methods self-consuming only. 2021-07-01 14:22:28 -07:00
Nathan Vegdahl
0ae522f3df Clean up Selection to not use so many allocations. 2021-07-01 14:22:28 -07:00
Nathan Vegdahl
77a266e818 Better validation method APIs for Range.
This way they do less work, are more specific to what we actually
need, and they compose.
2021-07-01 14:22:28 -07:00
Nathan Vegdahl
d07074740b Add Range methods for various kinds of validation. 2021-07-01 14:22:28 -07:00
Nathan Vegdahl
c1b0a71975 Change the Range type and associated functions to gap indexing. 2021-07-01 14:22:28 -07:00
Blaž Hrastnik
3007478567 fix: Correctly merge multiple selection ranges together
Fixes #391
2021-06-30 16:08:41 +09:00
PabloMansanet
de8745aea7 Incorporate long word commands into keymap 2021-06-30 00:56:19 +09:00
PabloMansanet
73572b7780 Add long word unit tests 2021-06-30 00:56:19 +09:00
PabloMansanet
073517a92f Add long word motion implementation 2021-06-30 00:56:19 +09:00
Blaž Hrastnik
51162ae6b2 fix ca98210d20 2021-06-28 18:05:20 +09:00
Blaž Hrastnik
ca98210d20 fix: insert() | delete() would calculate the new insert incorrectly
Refs #386
2021-06-28 17:49:34 +09:00
Blaž Hrastnik
d4e1ec339e Don't crash if diagnostics span past EOF 2021-06-28 14:50:35 +09:00
Blaž Hrastnik
1b102d5532 Extract the merge "operator" into helix-core 2021-06-27 23:28:22 +09:00
Blaž Hrastnik
44566ea812 Release 0.3.0 2021-06-27 13:27:47 +09:00
Nathan Vegdahl
a6cadddef4 Fix silly mistake in previous phantom line bug fix.
Fixes #381.  I was trying to change an index value that... wasn't
even an index value.
2021-06-26 14:26:18 +09:00
Nathan Vegdahl
2dba228c76 Fix highlight code splitting graphemes.
This resulted in phantom blank lines in files with CRLF line
endings, but could potentially have manifested with other
graphemes as well.
2021-06-26 11:09:50 +09:00
Gokul Soumya
394629ab73 Skip enclosed pairs in surround
Surround operations previously ignored other pairs that are
enclosed within which should be skipped. For example if the
cursor is on the `,` in `{{a},{b}}`, doing `md{` previously
would delete the `{` on the left of `a` and `}` on the right
of `b` instead of the outermost braces. This commit corrects
this behavior.
2021-06-24 13:02:56 +09:00
Nathan Vegdahl
9cbf564d08 Handle erroneously ignored case in RopeGraphemes iterator. 2021-06-24 10:04:03 +09:00
Blaž Hrastnik
7f6265ecf3 fix: crash with ctrl-c on empty file 2021-06-24 01:38:02 +09:00
Shafkath Shuhan
fd98e743e8 Handle non-UTF8 files 2021-06-23 15:40:27 +09:00
Nathan Vegdahl
38bf9c2576 Missed some items in the CRLF PR. 2021-06-23 12:43:09 +09:00
Blaž Hrastnik
9c53461429 fix: Select matching at the start of the doc could crash. Fixes #346 2021-06-23 12:27:38 +09:00
Gokul Soumya
892c80771a Correctly identify pairs when cursor on pair 2021-06-22 14:27:51 +09:00
Gokul Soumya
86271bac18 Refactor and add tests for surround 2021-06-22 14:27:51 +09:00
Gokul Soumya
4754b2e5ae Add more surround pair characters 2021-06-22 14:27:51 +09:00
Gokul Soumya
13648d28b9 Add surround keybinds 2021-06-22 14:27:51 +09:00
Nathan Vegdahl
f2954fa153 Flesh out the line ending utility unit tests. 2021-06-21 12:56:42 -07:00
Nathan Vegdahl
7c4fa18764 Fix clippy warnings. 2021-06-21 12:02:44 -07:00
Nathan Vegdahl
07e28802f6 Add function to get the line ending of a str slice.
This is needed in some places.
2021-06-21 10:29:29 -07:00
Nathan Vegdahl
3d3149e0d5 Silence clippy warning. 2021-06-20 16:13:59 -07:00
Nathan Vegdahl
e686c3e462 Merge branch 'master' of github.com:helix-editor/helix into line_ending_detection
Rebasing was making me manually fix conflicts on every commit, so
merging instead.
2021-06-20 16:09:14 -07:00
Nathan Vegdahl
4efd6713c5 Work on moving code over to LineEnding instead of assuming '\n'.
Also some general cleanup and some minor fixes along the way.
2021-06-20 15:33:02 -07:00
Nathan Vegdahl
5d22e3c4e5 Misc fixes and clean up of line ending detect code. 2021-06-20 00:40:41 -07:00
Blaž Hrastnik
e9a3245aae Re-export unicode crates from helix_core 2021-06-20 16:38:58 +09:00
Blaž Hrastnik
9275021497 ui: prompt: Better unicode support
We copied over eval_movement from wezterm, that already solves most of
our problems. self.cursor is now byte-based.
2021-06-20 16:38:58 +09:00
Jan Hrastnik
8634e04a31 added the line_end helper function 2021-06-20 02:22:10 +02:00