Commit Graph

145 Commits (1792dc6f935f581e7fed3842b1f01e2d5d3d7e05)

Author SHA1 Message Date
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 079d4ed86d Properly fix `last_line` view calculation.
Turned out to be simpler than I thought.  Didn't even need to change the
other use-sites.
2021-07-19 08:39:48 -07:00
Nathan Vegdahl 1a9ae72fcb Fix last line number being drawn in the status bar. 2021-07-18 23:09:55 -07:00
Nathan Vegdahl a77274e8bb Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-17 10:49:03 -07:00
Kirawi bb121a3e4b
Injection Query Support (#430)
* wip

* wip

* fixed unsafe

* fix clippy

* move out reference variable

* fmt

* remove arc

* change safety comment
2021-07-11 10:40:18 +09: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 4952d6f801 Fix phantom lines in some CRLF files.
Fixes #415.  The issue was that cursor highlighting wasn't extending
to encompass the entire CRLF grapheme, and therefore ended up splitting
it.  This presumably was messing up other grapheme rendering as
well, and this fixes that as well.
2021-07-05 20:07:06 +08:00
Ivan Tham 6710855eac Fix rendering issues for infobox 2021-07-04 18:01:59 +09:00
Ivan Tham 8985c58fd3 Add infobox 2021-07-04 18:01:59 +09:00
Nathan Vegdahl 22dca3b111 Allow last line in file to lack a line break character. 2021-07-01 23:36:09 -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 efa3389b6a Fix unused variable, parameter, and `mut` warnings in helix-term. 2021-07-01 19:06:52 -07:00
Nathan Vegdahl 702a0491db Remove #[allow(unused)] from helix-term, and fix unused imports.
Lots of other warning still left.  Will address in subsequent commits.
2021-07-01 19:06:52 -07:00
Nathan Vegdahl d07074740b Add `Range` methods for various kinds of validation. 2021-07-01 14:22:28 -07:00
Joe Neeman d64d75e724 Add some async job infrastructure. 2021-06-30 17:08:50 +09:00
Blaž Hrastnik e9159887a9 ui: Use a box drawing character vertical line for splits 2021-06-30 01:01:28 +09:00
Blaž Hrastnik 82fc28a0ce ui: Simplify conditional 2021-06-27 23:28:22 +09:00
Blaž Hrastnik bcca152ad5 Merge tab & char rendering code 2021-06-27 23:28:22 +09:00
Blaž Hrastnik 01b1a62e2c This char_index is unused 2021-06-27 23:28:22 +09:00
Blaž Hrastnik 4edfac21f6 Allocate the tab stop only once 2021-06-27 23:28:22 +09:00
Blaž Hrastnik 1b102d5532 Extract the merge "operator" into helix-core 2021-06-27 23:28:22 +09:00
Blaž Hrastnik ae58d813b2 Appease clippy 2021-06-27 23:28:22 +09:00
Blaž Hrastnik f9cdb2afe2 Turn diagnostics rendering into span injection too 2021-06-27 23:28:22 +09:00
Blaž Hrastnik 057bd630d8 Simplify selection rendering by injecting highlight scopes 2021-06-27 23:28:22 +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
Keith Simmons 4418e17547
reverse the dependency between helix-tui and helix-view (#366)
* reverse the dependency between helix-tui and helix-view by moving a fiew types to view

* fix tests

* clippy and format fixes

Co-authored-by: Keith Simmons <keithsim@microsoft.com>
2021-06-25 12:58:15 +09:00
Ivan Tham 10548bf0e3 Fix previous broken refactor key into helix-view
Need to be used for autoinfo

Revert "Revert "Refactor key into helix-view""

This reverts commit 10f9f72232.
2021-06-25 00:39:03 +09:00
wojciechkepka 3606d8bd24 Patch the primary cursor with insert and select styles 2021-06-23 21:55:02 +09:00
wojciechkepka c534fdefdc Refactor, add `ui.cursor.primary` 2021-06-23 21:55:02 +09:00
wojciechkepka d70be55f70 Add ability to theme primary selecition 2021-06-23 21:55:02 +09:00
wojciechkepka ac1e98d088 Add ability to theme cursor 2021-06-23 21:55:02 +09:00
Nathan Vegdahl 481c4ba044 Increment char_index by grapheme char count.
It was just assuming single-char graphemes before.
2021-06-23 12:43:09 +09:00
Blaž Hrastnik 20f33ead67 minor: Remove old TODOs 2021-06-22 23:26:34 +09:00
Blaž Hrastnik a70de6e980
Merge pull request #224 from helix-editor/line_ending_detection
Line ending detection
2021-06-22 11:09:19 +09:00
wojciechkepka cc357d5096 Add progress spinners to status line 2021-06-21 12:59:06 +09: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 5d22e3c4e5 Misc fixes and clean up of line ending detect code. 2021-06-20 00:40:41 -07:00
wojciechkepka 2d629a880c Fix overflow 2021-06-19 16:49:20 -04:00
Blaž Hrastnik 10f9f72232 Revert "Refactor key into helix-view"
Did not use defaults when custom keymap was used

This reverts commit ca806d4f85.
2021-06-19 23:59:19 +09:00
Jan Hrastnik cdd9347457 Merge remote-tracking branch 'origin/master' into line_ending_detection 2021-06-19 14:51:53 +02:00
Ivan Tham ca806d4f85 Refactor key into helix-view
Now also make use of Deserialize for Config.
2021-06-19 16:37:15 +09:00
wojciechkepka 1c1474c3b8 Add `ui.statusline.inactive`, use `ui.statusline` for statusline text 2021-06-18 15:18:58 -04:00
Benoît CORTIER 8664d70e73 Replace `Editor::current` by a macro
This is necessary to workaround ownership issues across function calls.
The issue notably arised when implementing the registers into `Editor`
and I was getting annoyed again when implementing copy/pasting into
system clipboard.
The problem is addressed by using macro calls instead of function calls.
There is no notable side effect.
2021-06-18 09:38:10 +09:00
PabloMansanet f7e00cf720
Configurable keys 2 (Mapping keys to commands) (#268)
* Add convenience/clarity wrapper for Range initialization

* Add keycode parse and display methods

* Add remapping functions and tests

* Implement key remapping

* Add remapping book entry

* Use raw string literal for toml

* Add command constants

* Make command functions private

* Map directly to commands

* Match key parsing/displaying to Kakoune

* Formatting pass

* Update documentation

* Formatting

* Fix example in the book

* Refactor into single config file

* Formatting

* Refactor configuration and add keymap newtype wrappers

* Address first batch of PR comments

* Replace FromStr with custom deserialize
2021-06-17 20:08:05 +09:00
Jan Hrastnik a4f5a0134e trying out line ending helper functions in commands.rs 2021-06-16 17:13:41 +02:00
Jan Hrastnik 3756c21bae rebase on branch line_ending_detection 2021-06-16 17:00:21 +02:00
Gokul Soumya d1c8a74771 Add theme key for selected line number
Adds `ui.linenr.selected` which controls highlight of linu numbes which
have cursors on.

- Fallback to linenr if linenr.selected is missing

- Update docs and themes

- Add TODOs for themes with temporary linenr.selected
2021-06-16 15:00:14 +09:00
Ivan Tham 124514aa70 Add cursor kind to separate hidden cursor from pos
Now IME cursor position should be correct since we can still set cursor
position without drawing the cursor.
2021-06-15 23:46:21 +08:00
Benoît CORTIER 6bdf609caa Remove RwLock for registers
Registers are stored inside `Editor` and accessed without `RwLock`.
To work around ownership, I added a sister method to `Editor::current`:
`Editor::current_with_context`. I tried to modify `Editor::current`
directly but it's used at a lot of places so I reverted into this for
now at least.
2021-06-15 23:01:56 +08:00