Commit graph

809 commits

Author SHA1 Message Date
Blaž Hrastnik
ce7ad2beb5 Reimplement keep-pipe, it needs to manipulate selections, not text 2021-09-01 11:09:50 +09:00
Blaž Hrastnik
dc609cafb5 Extract the shell command into a separate function 2021-09-01 10:46:35 +09:00
Blaž Hrastnik
a3bd80a6fa ui: prompt: Avoid allocating a prompt name if it's a static string 2021-08-31 18:29:24 +09:00
Blaž Hrastnik
9b96bb5ac8 Refactor a bit further 2021-08-31 18:24:24 +09:00
Blaž Hrastnik
4a76ea8f88 shell: Move changes outside so we can properly handle errors 2021-08-31 18:19:18 +09:00
Omnikar
e772808a5b
Shell commands (#547)
* Implement shell interaction commands

* Use slice instead of iterator for shell invocation

* Default to `sh` instead of `$SHELL` for shell commands

* Enforce trailing comma in `commands` macro

* Use `|` register for shell commands

* Move shell config to `editor` and use in command

* Update shell command prompts

* Remove clone of shell config

* Change shell function names to match prompts

* Log stderr contents upon external command error

* Remove `unwrap` calls on potential common errors

`shell` will no longer panic if:
  * The user-configured shell cannot be found
  * The shell command does not output UTF-8

* Remove redundant `pipe` parameter

* Rename `ShellBehavior::None` to `Ignore`

* Display error when shell command is used and `shell = []`

* Document shell commands in `keymap.md`
2021-08-31 18:13:16 +09:00
gbaranski
9c5752cbac fix: use .cursor() instead of .head 2021-08-30 12:03:10 -07:00
gbaranski
b590504143 fix: use head instead of anchor for relative line 2021-08-30 12:03:10 -07:00
Omnikar
03ad9e0bfa
Fix code indentation (#671) 2021-08-30 09:15:49 +09:00
CossonLeo
d6a9c2c0f6
Add ui.menu text style (#664)
* add menu text style

* add ui.menu.text ui.info ui.info.text to book

* change ui.menu.text to ui.menu

* fix book's ui.menu
2021-08-28 13:54:24 +09:00
Blaž Hrastnik
5cee3b634d ui: prompt: Fix typing with alt 2021-08-27 16:39:52 +09:00
Omnikar
bfce4d4f29
Make v in select mode switch back to normal mode (#660)
* Make `v` in select mode switch back to normal mode

* Move select mode toggle to keymap instead of command
2021-08-27 10:03:49 +09:00
Grzegorz Baranski
cec5d437d8
fix: show current line number even if relative line is on (#656) 2021-08-26 23:18:33 +05:30
Stuart Hinson
6192f2fa25
Show hidden files in filename completer (#648)
also removes unnecessary clone
2021-08-27 00:30:47 +09:00
Yusuf Bera Ertan
dc57f8dc89
feat: merge default languages.toml with user provided languages.toml, add a generic TOML value merge function (#654)
* feat: merge default languages.toml with user provided languages.toml

* refactor: use catch-all to override all other values for merge toml

* tests: add a test case for merging languages configs

* refactor: change test module name
2021-08-27 00:29:14 +09:00
Ivan Tham
4bafda3995
Change vsp to vs (#647)
Follow up on #639 to match vim behavior
2021-08-27 00:20:37 +09:00
Kirawi
b99db7c687
Move path util functions from helix-term to helix-core (#650) 2021-08-25 10:04:05 +09:00
Blaž Hrastnik
bf5b9a9f35 ui: Tone down the preview highlight by adding a new scope 2021-08-24 13:25:39 +09:00
Blaž Hrastnik
e6cb183134 ui: Fix preview window padding: we want horizontal, not vertical 2021-08-24 13:25:39 +09:00
Blaž Hrastnik
a5c3c6c6a9 ui: Highlight line ranges in the preview 2021-08-24 13:25:39 +09:00
CossonLeo
490125f008
info component style config use ui.info ui.info.text (#643) 2021-08-24 09:58:19 +09:00
Blaž Hrastnik
1d45f50781 fix: Don't internally use relative paths in the buffer picker
Fixes #619
2021-08-24 09:56:09 +09:00
devins2518
e1c9f13263
Add :vsplit and :hsplit commands (#639)
* add vsplit and hsplit commands

* handle splits more elegantly
2021-08-24 09:37:44 +09:00
dependabot[bot]
864618242b
Bump crossterm from 0.20.0 to 0.21.0 (#644)
Bumps [crossterm](https://github.com/crossterm-rs/crossterm) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/crossterm-rs/crossterm/releases)
- [Changelog](https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossterm-rs/crossterm/commits)

---
updated-dependencies:
- dependency-name: crossterm
  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-08-24 09:17:57 +09:00
Blaž Hrastnik
607b92b2e3 fix: Place the cursor on the start of the selected symbol
Fixes #626
2021-08-22 15:00:07 +09:00
Kirawi
59e0ceef8c
better panic messages for when you're missing selection scopes (#608) 2021-08-22 11:15:33 +09:00
Gokul Soumya
f9375f449c
Refactor new Rect construction (#575)
* Refactor new Rect construction

Introduces methods that can be chained to construct new Rects
out of pre-existing ones

* Clamp x and y to edges in Rect chop methods

* Rename Rect clipping functions
2021-08-21 14:21:20 +09:00
Blaž Hrastnik
d4c17b633c minor: Extract doc.text().slice(..) into a var 2021-08-20 13:42:47 +09:00
Blaž Hrastnik
38e932bd4c minor: Nicer errors, std::io::Error provides a Display impl 2021-08-20 13:42:17 +09:00
Blaž Hrastnik
a76ec9a64e Make scrolling extend in extend mode 2021-08-20 13:42:01 +09:00
Blaž Hrastnik
07fea61d03 Use the correct search register 2021-08-20 11:14:57 +09:00
Blaž Hrastnik
f60b549fb7 cargo fmt 2021-08-20 11:02:28 +09:00
Blaž Hrastnik
68626b8f78 ui: Refactor styling a bit, ensure infobox is stylable 2021-08-20 10:58:44 +09:00
Blaž Hrastnik
cbd39d67a4 minor: Refactor commands.rs a bit more 2021-08-20 10:43:22 +09:00
Kirawi
da8810809a use ui.text.focus for the picker (fix #622) 2021-08-20 10:43:08 +09:00
Blaž Hrastnik
0595b0626a Fix clippy attr 2021-08-19 16:05:05 +09:00
Blaž Hrastnik
5f8b1c7320 Avoid looking up ui.text per highlight range 2021-08-19 15:59:08 +09:00
Blaž Hrastnik
557fd86e71 Extract view.inner_area(), simplify render_focused_view_elements 2021-08-19 15:59:03 +09:00
Blaž Hrastnik
9776553ad0 Refactor view.first_line/first_col into view.offset (Position) 2021-08-19 12:52:07 +09:00
Blaž Hrastnik
115754c5ee Simplify write/write_all commands, we no longer need to excessively block 2021-08-19 11:37:42 +09:00
Blaž Hrastnik
12ea3888c5 fix: ui: Pin popups with no positioning to the initial cursor position
This avoids the floating popup following the cursor as we type.
2021-08-19 11:25:19 +09:00
Yerlan
18c0509593
Exit select mode after toggle_comment. Fixes #597 (#598)
Consistent with yanking, exit select mode after toggling comment. Fixes #597
2021-08-17 09:52:52 +09:00
Gokul Soumya
14c08e855f
Refactor infobox rendering and parsing (#579) 2021-08-17 09:25:48 +09:00
Grzegorz Baranski
78923496a6
feat: relative numbers (#485)
* feat(helix-view): configuring line-number

* feat(helix-term): relative line numbers

* feat(helix-term): passing editor::Config to render

* fix(helix-view): remove LineNumber::None

* feat(helix-term): rendering line-number according to configuration

* fix(term): put calculating current line above line iteration

* fix: add abs_diff function

* deps: cargo update

* fix: pass config argument
2021-08-16 11:11:53 +09:00
Blaž Hrastnik
1caedc18ca Release v0.4.1 2021-08-14 13:32:29 +09:00
Blaž Hrastnik
4167201344 ui: picker: Position count according to input bar 2021-08-13 18:00:04 +09:00
Blaž Hrastnik
eb9ac0a743 ui: picker: Use ui.selection instead of ui.selection.primary 2021-08-13 17:59:47 +09:00
Blaž Hrastnik
f20dc1283d ui: picker: Render matches/total counts 2021-08-13 17:56:37 +09:00
Blaž Hrastnik
fd1eaafff5 Add :tree-sitter-scopes, useful when developing indents.toml 2021-08-13 13:15:53 +09:00
Blaž Hrastnik
3de40de0a9 fix build... 2021-08-13 01:28:11 +09:00