Commit graph

1298 commits

Author SHA1 Message Date
Blaž Hrastnik
4e1b3b12f3 Refactor symbol picker to share code 2022-02-18 13:50:06 +09:00
Michael Davis
a8cf0c6b90
filter git revision on git command success exit code (#1674)
The unwrap (or '.ok()' rather) triggers for some errors but not
negative status codes. In the case where helix is being packaged
in an empty git repository, the existing mechanism will fail because

    git init
    git rev-parse HEAD

gives a negative exit code and prints to stderr

    stderr: "fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree....

with a stdout of "HEAD\n" (too short to slice with [..8]).
2022-02-18 13:05:12 +09:00
tomKPZ
368064e316
Fix bug when launching hx file.rs:10 (#1676) 2022-02-18 12:13:02 +09:00
Matouš Dzivjak
afec54485a
feat(commands): command palette (#1400)
* feat(commands): command palette

Add new command to display command pallete that can be used
to discover and execute available commands.

Fixes: https://github.com/helix-editor/helix/issues/559

* Make picker take the whole context, not just editor

* Bind command pallete

* Typable commands also in the palette

* Show key bindings for commands

* Fix tests, small refactor

* Refactor keymap mapping, fix typo

* Ignore sequence key bindings for now

* Apply suggestions

* Fix lint issues in tests

* Fix after rebase

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2022-02-17 14:03:11 +09:00
Blaž Hrastnik
24f90ba8d8 Manually recalculate initial completion where it matters 2022-02-17 14:02:42 +09:00
Blaž Hrastnik
af21e2a5b4 Pass through Editor instead of Context 2022-02-17 14:02:42 +09:00
Cole Helbling
e023a78919 WIP: show all buffers that couldn't be closed 2022-02-17 14:02:42 +09:00
Cole Helbling
6118486eb2 helix-term: implement buffer completer
In order to implement this completer, the completion function needs to
be able to access the compositor's context (to allow it to get the
list of buffers currently open in the context's editor).
2022-02-17 14:02:42 +09:00
Cole Helbling
a1207fd768 helix-term/commands: display buffer id in picker 2022-02-17 14:02:42 +09:00
Blaž Hrastnik
d11b652139 Allow static strings in set_status/set_error so API is nicer 2022-02-15 16:45:28 +09:00
Blaž Hrastnik
fd0e4b1159 dap: Reduce amount of block_on uses 2022-02-15 16:30:23 +09:00
Gokul Soumya
966fbc5984 Add tree-sitter based function, class navigation 2022-02-15 14:04:46 +09:00
Blaž Hrastnik
1422449537 .. 2022-02-15 11:37:33 +09:00
Blaž Hrastnik
eeb9b39857 Fix build on master 2022-02-15 10:33:55 +09:00
Ludwig Stecher
4429993842
Add PageUp, PageDown, Ctrl-u, Ctrl-d, Home, End keyboard shortcuts to file picker (#1612)
* Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard shortcuts to file picker

* Refactor file picker paging logic

* change key mapping

* Add overlay component

* Use closure instead of margin to calculate size

* Don't wrap file picker in `Overlay` automatically
2022-02-15 10:24:03 +09:00
Kirawi
23907a063c
use PathBuf::to_string_lossy() instead of to_str() (#1655) 2022-02-15 10:22:55 +09:00
Gokul Soumya
4c424d5ee4
Refactor language config loading (#1658) 2022-02-15 01:41:53 +09:00
Blaž Hrastnik
97d4b2b5fe Mark DAP as experimental 2022-02-13 18:32:57 +09:00
Blaž Hrastnik
bd549d8a20 Merge remote-tracking branch 'origin/master' into debug 2022-02-13 18:31:51 +09:00
Cydiater
7083b98a38
postpone clone after found (#1656) 2022-02-13 13:53:35 +09:00
Blaž Hrastnik
1bcb624ae6 Instant is more suitable than SystemTime for spinners 2022-02-10 11:12:47 +09:00
Blaž Hrastnik
f88c077f99 Replace tendril with smartstring
Slightly smaller API surface, less dependencies.
2022-02-10 11:12:47 +09:00
Matouš Dzivjak
fdb9a1677b
feat(editor): add config for search wrap_around (#1516)
* feat(editor): add config for search wrap_around

Fixes: https://github.com/helix-editor/helix/issues/1489

* Move search settings into separate config

* Disable linter
2022-02-10 11:04:40 +09:00
Gokul Soumya
bf773db451 Show infobox with register contents 2022-02-10 10:52:06 +09:00
Gokul Soumya
5995568c1d Prevent multiple code action popups 2022-02-08 16:44:39 +09:00
Gokul Soumya
547c3ecd0c Preselect first item in code action popup menu 2022-02-08 16:44:39 +09:00
Gokul Soumya
e90276df0b Replace if let with early return 2022-02-08 16:44:39 +09:00
Blaž Hrastnik
23553bd37c Update dependencies (crossterm 0.23, tree-sitter 0.20.4)
Fixes #677
2022-02-07 10:47:57 +09:00
Blaž Hrastnik
e7f5ec5561 fix: There is no such thing as markup.normal, use ui.text 2022-02-07 10:30:03 +09:00
Blaž Hrastnik
6ea477ab60 Don't use block_on in jobs.finish(), we can .await 2022-02-05 15:05:19 +09:00
Blaž Hrastnik
d3221b03a2 fix: Only parse git revision, don't use the tag for version
If building from source and the source is contained in a larger
repository, we'd contain the wrong version. It's also easy to
accidentally have a newer tag that would change the version.
2022-02-03 01:19:44 +09:00
Blaž Hrastnik
36b975c4ce ui: menu: Don't allocate scrollbar space if options fit 2022-02-01 01:25:59 +09:00
Blaž Hrastnik
f10a06f4de ui: Only render menu scrollbar if it doesn't fit 2022-01-31 16:04:58 +09:00
Blaž Hrastnik
094a0aa3f9 Render code actions as a menu, allow adding padding to popup 2022-01-31 16:04:58 +09:00
Blaž Hrastnik
f7f55143a1 Improve code action picker by displaying it inline 2022-01-31 16:04:58 +09:00
Blaž Hrastnik
62561e9d23 Stop collecting highlight_iter events then turning back into iter 2022-01-30 22:38:44 +09:00
Blaž Hrastnik
5aead46f4b Remove some unnecessary clippy tags 2022-01-30 22:38:44 +09:00
Blaž Hrastnik
2a7ae963e1 Automatically commit changes to history if not in insert mode
Fixes #1500
2022-01-30 22:38:44 +09:00
CossonLeo
d49e5323f9
Use markup scopes for the Markdown component (#1363) 2022-01-24 10:41:25 +09:00
Benjamin
4044c70eb2
Fix picker won't scroll down when it hits the bottom #1544 (#1567) 2022-01-23 23:06:28 +09:00
Ivan Tham
759b850859
Allow specifying file start position (#445)
Like helix-term/src/commands.rs:3426:15
2022-01-23 16:54:03 +09:00
Blaž Hrastnik
e2d2f19fd0
Merge pull request #1154 from sudormrfbin/cursor-shape-new
Change cursor shape on mode change
2022-01-23 16:35:22 +09:00
Blaž Hrastnik
add3be8528 Slicing micro-optimization 2022-01-23 16:04:26 +09:00
Blaž Hrastnik
11c3ba9350 Speed up ensure_next_boundary during render
This code:

    let start = ensure_grapheme_boundary_next(text, text.byte_to_char(start));
    let end = ensure_grapheme_boundary_next(text, text.byte_to_char(end));

Would convert byte to char index, but then internally immediately convert back
to byte index, operate on it, then convert it to char index.

This change reduces the amount of time spent in ensure_grapheme_boundary from
29% to 2%.
2022-01-23 16:04:12 +09:00
Blaž Hrastnik
53d881f172 Store theme scopes on the loader, this way theme isn't passed around 2022-01-23 16:00:24 +09:00
Blaž Hrastnik
6728e44490 syntax: Split parsing and highlighting 2022-01-23 16:00:24 +09:00
Michael Davis
f453f8724d
change show_subtree command into ':tree-sitter-subtree' typable command (#1524)
* add default keymap for show_subtree command

* remove space+t keymap

* add a typable command ':show-subtree'

* generate documentation for ':show-subtree'

* remove non-typable show_subtree command

* ':show-subtree'->':tree-sitter-subtree'
2022-01-21 23:15:35 +09:00
Michael Davis
392dfa0841
add select_next_sibling and select_prev_sibling commands (#1495)
* add select_next_sibling and select_prev_sibling commands

* refactor objects to use higher order functions

* address clippy feedback

* move selection cloning into commands

* add default keybindings under left/right brackets

* use [+t,]+t for selecting sibling syntax nodes

* setup Alt-{j,k,h,l} default keymaps for syntax selection commands

* reduce boilerplate of select_next/prev_sibling in commands

* import tree-sitter Node type in commands
2022-01-21 00:52:33 +09:00
Skyler Hawthorne
96d4ca5f73
Dependabot/cargo/pulldown cmark 0.9.1 (#1533)
* build(deps): bump pulldown-cmark from 0.8.0 to 0.9.1

Bumps [pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) from 0.8.0 to 0.9.1.
- [Release notes](https://github.com/raphlinus/pulldown-cmark/releases)
- [Commits](https://github.com/raphlinus/pulldown-cmark/compare/v0.8.0...v0.9.1)

---
updated-dependencies:
- dependency-name: pulldown-cmark
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* cmark 0.9 fixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-18 09:41:44 +08:00
Blaž Hrastnik
e7eab95b94 Update to rust 1.58, fix a bunch of optional lints 2022-01-16 14:19:48 +09:00