Commit graph

1862 commits

Author SHA1 Message Date
Kirawi
6f1a7b1220
Add llvm grammar (#1167) 2021-11-29 10:38:17 +09:00
Gokul Soumya
dc53e65b9e
Fix surround cursor position calculation (#1183)
Fixes #1077. This was caused by the assumption that a block
cursor is represented as zero width internally and simply
rendered to be a single width selection, where as in reality
a block cursor is an actual single width selection in form and
function.

Behavioural changes:

1. Surround selection no longer works when cursor is _on_ a
    surround character that has matching pairs (like `'`
    or `"`). This was the intended behaviour from the start
    but worked till now because of the cursor position
    calculation mismatch.
2021-11-29 10:33:53 +09:00
ath3
1d773bcefb
Implement black hole register (#1165) 2021-11-28 10:21:40 +09:00
RustyStriker
103b5125e4
Detect filetype on :write (#1141)
fixes #1136

* removed a log::info

* removed temp.rs

* cargo clippy no longer complains

* new get_lang_server function

* get_lang_server is now launch_language_server

* launch_lang_server will now close the previous one

* better code readability

* remove resfresh_ls(and a wrong comment)
2021-11-28 10:19:54 +09:00
ath3
3b2b7341a5
Fix next char delete key documentation for prompt (#1180) 2021-11-28 10:18:25 +09:00
Kirawi
4ec20eaeff
Add language support for WGSL (#1166) 2021-11-27 07:49:40 +05:30
Blaž Hrastnik
6e62c3de47 Simplify some code in editor.rs 2021-11-26 18:26:22 +09:00
Gokul Soumya
17473b51d3 Use serde attribute to rename to lowercase 2021-11-25 22:35:07 +05:30
Ivan Tham
67bf4250ca
Optimize space for DocumentId with NonZeroUsize (#1097)
Now Option<DocumentId> uses one byte rather than two
2021-11-25 11:07:23 +09:00
Thanabodee Charoenpiriyakij
e8f800a141
Do not crash when run goto command without line number (#1160)
* Do not crash when run goto command without line number

Report an error when running goto command without entering a
line number.

Fixes #1159

* Use is_empty() instead check len zero
2021-11-25 11:02:51 +09:00
Thanabodee Charoenpiriyakij
95f392b18d
Fix bug report template use wrong hx version (#1158) 2021-11-24 20:58:25 +05:30
shenlebantongying
1eecd9a2ac
Add language: racket (#1143) 2021-11-24 22:47:12 +09:00
ath3
72f606ee19
Implement no-yank delete/change (#1099) 2021-11-24 16:46:40 +09:00
Gokul Soumya
7961355ba1 Change cursor shape on mode change
Fixes #323. Due to terminal limitations we can only
change the shape of the primary cursor.
2021-11-24 12:26:49 +05:30
Martin Junghanns
57c14d4a93
Add :<line> and :goto <line> commands (#1128)
* Add typable `goto` command

* Support `:<line-number>` on prompt

* Rename function according to convention

* Directly call into goto_line_number function
2021-11-24 15:26:55 +09:00
Bob
21143e8d22
Align selections via & (#1101)
* align lines

* remove log statement

* use selections to align

* fix a clippy issue

* only accept 1,2,3 as user count

* Update helix-term/src/commands.rs

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* return if user count is not correct

* add doc

Co-authored-by: Ivan Tham <pickfire@riseup.net>
2021-11-23 23:08:05 +09:00
dependabot[bot]
f24e5a3c41
build(deps): bump tokio from 1.13.1 to 1.14.0 (#1146)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.13.1 to 1.14.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.13.1...tokio-1.14.0)

---
updated-dependencies:
- dependency-name: tokio
  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-11-23 10:07:59 +09:00
dependabot[bot]
2cc19bd8e4
build(deps): bump serde_json from 1.0.70 to 1.0.71 (#1147)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.70 to 1.0.71.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.70...v1.0.71)

---
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>
2021-11-23 09:56:58 +09:00
dependabot[bot]
a2f301ee4f
build(deps): bump anyhow from 1.0.46 to 1.0.48 (#1144)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.46 to 1.0.48.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.46...1.0.48)

---
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>
2021-11-23 09:56:35 +09:00
dependabot[bot]
8fec8c0791
build(deps): bump tree-sitter from 0.20.0 to 0.20.1 (#1145)
Bumps [tree-sitter](https://github.com/tree-sitter/tree-sitter) from 0.20.0 to 0.20.1.
- [Release notes](https://github.com/tree-sitter/tree-sitter/releases)
- [Commits](https://github.com/tree-sitter/tree-sitter/compare/v0.20.0...v0.20.1)

---
updated-dependencies:
- dependency-name: tree-sitter
  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>
2021-11-23 09:55:20 +09:00
NexiNov
4238a843f7
Add link to Keymap page in book. (#1137) 2021-11-22 20:14:42 +05:30
NNB
1724930765
Fix "good first issue" link (#1140) 2021-11-22 07:16:26 +09:00
Dan Nases Sha
6a4d9693ba
File picker config (#988)
* squashed WIP commits

* hide_gitignore working with config

* pass reference to new config parameter of file_picker()

* update config option name to match name on walk builder

* add comments to config and documentation of option to book

* add git_ignore option to WalkBuilder within prompt in commands.rs

* WIP: add FilePickerConfig struct

* WIP: cleanup

* WIP: add more options including max_depth

* WIP: changed defaults to match ignore crate defaults

* WIP: change WalkBuilder in global_search() to use config options

* WIP: removed follow_links, changed max_depth to follow config setting

* WIP: update book with file-picker inline table notation

* update documentation for file-picker config in book

* adjusted to [editor.file-picker] in book configuration.md

* adjust comments in editor.rs to be doc comments, cleanup

* adjust comments

* adjust book
2021-11-20 23:23:36 +09:00
Skyler Hawthorne
05c6cb1d0b
Solarized theme: fix popup colors, adjust menu (#1124)
* fix popup colors, adjust menu

* fix hardcoded horizontal rule color
2021-11-20 23:17:38 +09:00
Martin Junghanns
a3a3b0b517
Jump to end char of surrounding pair from any cursor pos (#1121)
* Jump to end char of surrounding pair from any cursor pos

* Separate bracket matching into exact and fuzzy search

* Add constants for bracket chars

* Abort early if char under cursor is not a bracket

* Simplify bracket char validation

* Refactor node search and unify find methods

* Remove bracket constants
2021-11-20 23:17:25 +09:00
Koen Van der Auwera
b95c9470de
Add spacebones light theme (#1131)
* Add spacebones light theme

* Fix error background
2021-11-20 07:22:06 +05:30
Kirawi
ed76cdf238
revert log truncation (#895) (#1130) 2021-11-19 13:26:39 +09:00
Blaž Hrastnik
2b7c086653 fix: Expand tilde first, then deal with relative paths
Otherwise the ~ gets treated as a relative path.

Fixes #1107
2021-11-19 12:09:17 +09:00
Martin Junghanns
f2b4ff23ba
Document scrolling for hover command in keymap.md (#1117)
* Document scrolling for hover command in keymap.md

* Move popup keys to a dedicated section
2021-11-19 11:58:22 +09:00
WindSoilder
5959356a24
Implement indent-aware delete (#1120)
* delete character backward can make undent behavior

* improve to handle mixed indentation
2021-11-19 00:19:40 +09:00
Ivan Tham
bd56dde6e2
Ensure cursor in view after pipe (#1123)
Fix #1024
2021-11-18 18:46:27 +09:00
Blaž Hrastnik
e9dc658de4 Remove unused imports 2021-11-18 18:41:44 +09:00
Blaž Hrastnik
9dcccb45bb ui: Stop hardcoding markdown doc colors 2021-11-18 18:40:27 +09:00
Blaž Hrastnik
27ceeb83bb Simplify view/doc macros 2021-11-18 14:13:42 +09:00
Blaž Hrastnik
fa4c59df46 Simplify compositor.find 2021-11-18 11:09:04 +09:00
ath3
90fd09f2cc
Fix selection remove doc comment (#1122) 2021-11-18 09:49:56 +09:00
WindSoilder
1132b7088a improve nord status bar line 2021-11-16 22:06:21 +08:00
Blaž Hrastnik
8db6fffe90 ui: Increase diagnostics sideline width to 100 max and wrap if needed 2021-11-16 15:02:48 +09:00
Skyler Hawthorne
335ed7fa69
Improve Solarzed Dark theme (#1105)
Adjusts the Solarized Dark theme to be modeled more closely after
vim's incarnation. Also adjust the Solarized Light theme to match.
2021-11-16 12:34:25 +09:00
dependabot[bot]
f1d3d97004
build(deps): bump libloading from 0.7.1 to 0.7.2 (#1113)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/nagisa/rust_libloading/releases)
- [Commits](https://github.com/nagisa/rust_libloading/commits)

---
updated-dependencies:
- dependency-name: libloading
  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>
2021-11-16 11:22:01 +09:00
dependabot[bot]
39479949fc
build(deps): bump serde_json from 1.0.69 to 1.0.70 (#1112)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.69 to 1.0.70.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.69...v1.0.70)

---
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>
2021-11-16 11:21:32 +09:00
dependabot[bot]
bc31d998de
build(deps): bump cc from 1.0.71 to 1.0.72 (#1111)
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.71 to 1.0.72.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.71...1.0.72)

---
updated-dependencies:
- dependency-name: cc
  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>
2021-11-16 11:21:20 +09:00
dependabot[bot]
411f522e5d
build(deps): bump arc-swap from 1.4.0 to 1.5.0 (#1110)
Bumps [arc-swap](https://github.com/vorner/arc-swap) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/vorner/arc-swap/releases)
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: arc-swap
  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-11-16 11:21:14 +09:00
dependabot[bot]
7e4418468a
build(deps): bump tokio from 1.13.0 to 1.13.1 (#1109)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.13.0...tokio-1.13.1)

---
updated-dependencies:
- dependency-name: tokio
  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>
2021-11-16 11:21:02 +09:00
Cole Helbling
225e7904ec
helix-view/editor: use SCRATCH_BUFFER_NAME const (#1104) 2021-11-16 01:46:39 +09:00
NexiNov
c95cb2be28
Remove extra instance of delete_word_backword in book (#1103) 2021-11-16 01:46:27 +09:00
Blaž Hrastnik
dd98727bad fix: editor.close now takes only a single parameter 2021-11-16 00:37:30 +09:00
Jason Hansen
6cb35d28a8
Add command to inc/dec number under cursor (#1027)
* Add command to inc/dec number under cursor

With the cursor over a number in normal mode, Ctrl + A will increment the
number and Ctrl + X will decrement the number. It works with binary, octal,
decimal, and hexidecimal numbers. Here are some examples.

0b01110100
0o1734
-24234
0x1F245

If the number isn't over a number it will try to find a number after the
cursor on the same line.

* Move several functions to helix-core

* Change to work based on word under selection

* It no longer finds the next number if the cursor isn't already over
  a number.
* It only matches numbers that are part of words with other characters
  like "foo123bar".
* It now works with multiple selections.

* Add some unit tests

* Fix for clippy

* Simplify some things

* Keep previous selection after incrementing

* Use short word instead of long word

This change requires us to manually handle minus sign.

* Don't pad decimal numbers if no leading zeros

* Handle numbers with `_` separators

* Refactor and add tests

* Move most of the code into core
* Add tests for the incremented output

* Use correct range

* Formatting

* Rename increment functions

* Make docs more specific

* This is easier to read

* This is clearer

* Type can be inferred
2021-11-16 00:32:58 +09:00
Bob
46d9ae2b62
Readline style insert mode (#1039)
* readline style insert mode

* update keymap.md

* don't save change history in insert mode

* Revert "don't save change history in insert mode"

This reverts commit cb47f946d7fb62ceda68e7d1692a3914d0be7762.

* don't affect register and history in insert mode

* add insert_register

* don't call exit_select_mode in insert mode

* avoid set_selection

* avoid duplicated current!
2021-11-16 00:31:20 +09:00
Cole Helbling
c638b6b60e
helix-term/commands: implement buffer-close (bc, bclose) (#1035)
* helix-view/view: impl method to remove document from jumps

* helix-view/editor: impl close_document

* helix-view/editor: remove close_buffer argument from `close`

According to archseer, this was never implemented or used properly. Now
that we have a proper "buffer close" function, we can get rid of this.

* helix-term/commands: implement buffer-close (bc, bclose)

This behaves the same as Kakoune's `delete-buffer` / `db` command:

* With 3 files opened by the user with `:o ab`, `:o cd`, and `:o ef`:
  * `buffer-close` once closes `ef` and switches to `cd`
  * `buffer-close` again closes `cd` and switches to `ab`
  * `buffer-close` again closes `ab` and switches to a scratch buffer
* With 3 files opened from the command line with `hx -- ab cd ef`:
  * `buffer-close` once closes `ab` and switches to `cd`
  * `buffer-close` again closes `cd` and switches to `ef`
  * `buffer-close` again closes `ef` and switches to a scratch buffer
* With 1 file opened (`ab`):
  * `buffer-close` once closes `ab` and switches to a scratch buffer
  * `buffer-close` again closes the scratch buffer and switches to a new
    scratch buffer

* helix-term/commands: implement buffer-close! (bclose!, bc!)

Namely, if you have a document open in multiple splits, all the splits
will  be closed at the same time, leaving only splits without that
document focused (or a scratch buffer if they were all focused on that
buffer).

* helix-view/tree: reset focus if Tree is empty
2021-11-16 00:30:45 +09:00