Commit graph

1181 commits

Author SHA1 Message Date
Nathan Vegdahl
427ae6ac6c Put selection in separate variable in commands code. 2021-07-23 17:06:14 -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
Nathan Vegdahl
673338bdb6 Use Range::line_range() in some more places I missed. 2021-07-22 10:50:12 -07:00
Nathan Vegdahl
7d07704e6f Fix append mode not editing correctly.
This is currently a bit of a hack, and still doesn't behave quite how we
probably want.  Left a TODO.
2021-07-21 09:56:21 -07:00
Nathan Vegdahl
063aa9452d Fix yank not working with internally zero-width ranges. 2021-07-21 09:32:48 -07:00
Nathan Vegdahl
bc85c85501 Fix selections not being modified quite correctly with text edits. 2021-07-21 09:23:01 -07:00
Nathan Vegdahl
198fe40951 Don't insert a final line ending on file load/reload. 2021-07-20 18:40:41 -07:00
Nathan Vegdahl
c848ed7abc Fixes for misc bugs with view movement. 2021-07-20 18:15:34 -07:00
Nathan Vegdahl
d5534a6d10 Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-20 13:35:37 -07:00
Nathan Vegdahl
1194fc842a Use new Range::line_range() method in more places, as appropriate. 2021-07-20 12:40:58 -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
e8a3980e46 Fix line-wise p pasting before the current line instead of after. 2021-07-20 10:56:27 -07:00
Nathan Vegdahl
1910fa7723 Fix incorrect line hihglight when a selection is at the end of a line. 2021-07-20 10:26:00 -07:00
Ivan Tham
17f9dfce7e Fix typo 2021-07-20 22:10:43 +09:00
Luctius
585d6f8242 Fixes toggle_comment not finding the correct language comment token 2021-07-20 17:10:17 +09:00
dependabot[bot]
d754c72b4d Bump tokio from 1.8.1 to 1.8.2
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.8.1...tokio-1.8.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-20 13:31:14 +08:00
Nathan Vegdahl
1792dc6f93 Make search work a little nicer when there are already selections.
Specifically, if you have text like "aaaaaaaaa" and you search
for "a", the new behavior will actually progress through all of the
"a"s, whereas the previous behavior would be stuck on a single one.
2021-07-19 18:29:26 -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
13b0784009 Fix extend line behavior. 2021-07-19 17:44:18 -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
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
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
5292fe0f7d Calculate completion popup sizing
Fixes #220
2021-07-19 11:29:51 +09: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
c2fd55e168 Update extend_line command to work with gap indexing. 2021-07-17 11:28:20 -07:00
Nathan Vegdahl
954314a7c9 Update change-case commands to work with gap indexing. 2021-07-17 11:03:39 -07:00
Nathan Vegdahl
a77274e8bb Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-17 10:49:03 -07:00
kabirz
6cba62b499 action: copy grammar libraries to runtime 2021-07-18 01:06:44 +09:00
Cor
9fcbbfa467 Changed startup behaviour to only open a single view when multiple files are specified on the commandline.
Changed the behaviour; the first argument on the commandline is the file on display
2021-07-18 00:29:05 +09:00
Blaž Hrastnik
000b7b7c97 Make instructions regarding runtime clearer 2021-07-18 00:22:58 +09:00
Cor Peters
722cfedb38
Added change_case command (#441)
* Added change_case command

* Added switch_to_uppercase and switch_to_lowercase

Renamed change_case to switch_case.

* Updated the Keymap section of the Book

* Use flat_map instead of map + flatten

* Fix switch_to_uppercase using to_lowercase

* Switched 'Alt-`' to uppercase and '`' to lowercase

Co-authored-by: Cor <prive@corpeters.nl>
2021-07-17 01:12:59 +09:00
Cor
e2bcef718a Removed double entry of extend_line 2021-07-15 23:25:00 +09:00
Kirawi
0b1ed8656d
Fix #442 (#446)
* fix #442

fix #442

fmt

* create Rope from default line ending

* Fix use of encoding in Document::open()
2021-07-15 11:22:34 +09:00
Kirawi
d84b3a198a Update dark_plus.toml
Didn't realize what `ui.statusline.active` was for. It's needed for view splits.
2021-07-15 09:49:05 +09:00
Blaž Hrastnik
a4b077e9b9 Build ts/tsx again, refactor collect_tree_sitter_dirs 2021-07-14 10:00:05 +09:00
Blaž Hrastnik
3ca05fce31 Fix number highlighting 2021-07-14 10:00:05 +09:00
Blaž Hrastnik
e6bf6a8f28 Build each grammar in it's own src dir
Windows places temporary files in the current dir, so compiling in
parallel caused conflicts.
2021-07-14 10:00:05 +09:00
Blaž Hrastnik
a7fa5621ce Try to rearrange the file order? 2021-07-14 10:00:05 +09:00
Blaž Hrastnik
c8dc9b64dd windows: Try building inside OUT_DIR? 2021-07-14 10:00:05 +09:00
Blaž Hrastnik
dd2903ff10 Dynamically load grammar libraries at runtime 2021-07-14 10:00:05 +09:00
dependabot[bot]
dd5e8082e4 Bump anyhow from 1.0.41 to 1.0.42
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.41 to 1.0.42.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.41...1.0.42)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 09:59:13 +09:00