Commit Graph

445 Commits (d5d1a9b1ae3bb7e02c86d0785e74f90358a048c6)

Author SHA1 Message Date
Blaž Hrastnik 2dbf966293 dap: Start working on runInTerminal support 3 years ago
Blaž Hrastnik d14ca05d6b Simplify some cases that use return None to use ? 3 years ago
Blaž Hrastnik 9ed930b233 Merge remote-tracking branch 'origin/master' into debug 3 years ago
Blaž Hrastnik 30171416cb Gutter functions 3 years ago
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.
3 years ago
ath3 1d773bcefb
Implement black hole register (#1165) 3 years ago
Blaž Hrastnik d1854d8e6a Merge remote-tracking branch 'origin/master' into debug 3 years ago
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
3 years ago
Blaž Hrastnik 2b7c086653 fix: Expand tilde first, then deal with relative paths
Otherwise the ~ gets treated as a relative path.

Fixes #1107
3 years ago
ath3 90fd09f2cc
Fix selection remove doc comment (#1122) 3 years ago
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
3 years ago
Ivan Tham b7c3877e94
Add movement shortcut for history (#1088)
alt-u and alt-U
3 years ago
ath3 6fa76d9fe7
Add trim_selections command (#1092) 3 years ago
Blaž Hrastnik 1817b7f581 minor: Import Range too 3 years ago
ath3 35c974c9c4
Implement "Goto last modification" command (#1067) 3 years ago
Omnikar bf95a9ed04
Add `remove_selections` command (#1065)
* Add `remove_selections` command

* Document `remove_selections`

* Update helix-term/src/keymap.rs

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
3 years ago
Omnikar a424ef4e20
Use default `languages.toml` if user's is invalid (#994) 3 years ago
Blaž Hrastnik e18198aeb2 Revert "fix(core): stop merging array toml config values (#1004)"
It breaks languages.toml merging

This reverts commit 4304b52ff8.
3 years ago
Blaž Hrastnik f804ed3192 Make shebangs optional, they don't make sense outside of scripts 3 years ago
Blaž Hrastnik 549cdee561 Refactor shebang detection to reuse the loaded buffer 3 years ago
ath3 77dbbc73f9
Detect filetype from shebang line (#1001) 3 years ago
Blaž Hrastnik 82ff5b0ab6 Specify capacity on toggle_line_comments 3 years ago
Daniel S Poulin 1e793c2bbf
Adds single and double quotes to matching pairs (#995)
This enables `mm` to work on quote characters as well as highlighting of
matching quote when on it.
3 years ago
Omnikar a252ecd8c8
Add WORD textobject (#991)
* Add WORD textobject

* Document WORD textobject
3 years ago
Carter Snook 4304b52ff8
fix(core): stop merging array toml config values (#1004) 3 years ago
Blaž Hrastnik f2b709a3c3 Merge branch 'master' into debug 3 years ago
Blaž Hrastnik f979bdc442 Specify capacity on toggle_line_comments 3 years ago
Blaž Hrastnik e80708eba7 Make sure document diagnostics are sorted 3 years ago
Blaž Hrastnik 6431b26a6a Implement Selection::replace to replace a single range
Fixes #985

Co-authored-by: Daniel S Poulin <crimsonmage+github@gmail.com>
3 years ago
Ivan Tham 3eb829e233
Ensure coords in screen depends on char width (#885)
The issue affected files with lots of tabs at the start as well.

Fix #840
3 years ago
Kirawi ee889aaa85
Updated tree-sitter query scopes (#896)
* updated theme scopes

variable.property -> variable.field
property -> variable.field

* updated theme scopes

* update book and themes

updated book and themes to reflect scope changes

* wip

* update more queries

* update dark_plus.toml
3 years ago
cossonleo befecc8a9a select smaller range on some case 3 years ago
Omnikar 45fadf6151
Add hyperlinks to fix `cargo doc` warn (#931) 3 years ago
Blaž Hrastnik f3c7f20dbc Release v0.5.0 3 years ago
Gygaxis Vainhardt 0a38983ee3
Remove three transmutes from helix-core syntax.rs (#923) 3 years ago
Kirawi 92c2d5d3bf
Document more of helix-core (#904) 3 years ago
Blaž Hrastnik 3edca7854e completion: fully revert state before apply & insertText common prefix 3 years ago
Blaž Hrastnik bfb6cff5a9 fix: Compose where changes.compose(empty_other) 3 years ago
Dmitry Sharshakov 6aa9838ea6
dap: support arrays as arguments 3 years ago
Blaž Hrastnik cee7ad781e Mark a few functions as `const` 3 years ago
Kirawi 0cb5e0b2ca
log syntax highlighting init errors (#895) 3 years ago
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
3 years ago
Blaž Hrastnik 182a59b552 Update to rust 1.56 + 2021 edition 3 years ago
Michael Davis 1766bdb9d4
clean up combined-injections comment (#880) 3 years ago
Blaž Hrastnik 83a8167402 Invert core -> dap dependency 3 years ago
Blaž Hrastnik 0a6b60085a Merge branch 'master' into debug 3 years ago
Dmitry Sharshakov 48cb81eff1
Merge branch 'master' into debug 3 years ago
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
3 years ago
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
3 years ago
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>
3 years ago