Commit graph

1089 commits

Author SHA1 Message Date
Blaž Hrastnik
05d3ad4a0e dap: Remove an excess clone on enable_exceptions 2021-11-22 00:02:58 +09:00
Blaž Hrastnik
d1854d8e6a Merge remote-tracking branch 'origin/master' into debug 2021-11-21 20:06:45 +09:00
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
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
fa4c59df46 Simplify compositor.find 2021-11-18 11:09:04 +09:00
Blaž Hrastnik
8db6fffe90 ui: Increase diagnostics sideline width to 100 max and wrap if needed 2021-11-16 15:02:48 +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
Cole Helbling
87e61a0894
helix-term/commands: implement cquit (#1096)
This allows you to exit helix with an exit code, e.g. `:cq 2`.
2021-11-15 13:06:12 +09:00
Blaž Hrastnik
f5e070e808 minor: Remove leftover log line 2021-11-15 10:33:14 +09:00
Blaž Hrastnik
e128a8702e Implement MarkedString rendering
Solves typescript and python documentation rendering
2021-11-15 10:30:05 +09:00
Ivan Tham
b7c3877e94
Add movement shortcut for history (#1088)
alt-u and alt-U
2021-11-15 00:16:47 +09:00
ath3
6fa76d9fe7
Add trim_selections command (#1092) 2021-11-15 00:16:20 +09:00
Ebbe Steenhoudt
edc976b6bb
Added workspace_symbol_picker (#1041)
* Added workspace_symbol_picker

* Moved truncation of the symbol pickers to the end.

* Fixed typo
2021-11-15 00:12:56 +09:00
ath3
35c974c9c4
Implement "Goto last modification" command (#1067) 2021-11-15 00:11:53 +09:00
Gygaxis Vainhardt
0949a0de7f
Add commit hash to version info, if present (#957)
* Add commit hash to version info, if present

* Rename GIT_HASH to indicate that it includes version, fix linter error

* Add whitespace after use statement

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

Co-authored-by: Ivan Tham <pickfire@riseup.net>
2021-11-15 00:09:02 +09:00
Cole Helbling
b74912ea78 helix-term/editor: display scratch buffer name in status bar 2021-11-14 12:33:17 +05:30
Cole Helbling
b824e091a9
helix-term/commands: move SCRATCH_BUFFER_NAME to helix-view/document (#1091)
This way, the name is accessible everywhere `Document` and related types
are.
2021-11-13 13:15:41 +09:00
Omnikar
6d4409c00f
Make prompts consistent (#1080) 2021-11-13 01:34:49 +09:00
Blaž Hrastnik
d3def16584 fix: shift-tab mappings broken after efc2b4c7 2021-11-12 16:21:03 +09:00
NexiNov
187197afb1
Add arrow keys to view mode (#987)
* Add arrow keys to view mode

* Drop C-up and C-down

* Update docs for #987

* Format correctly

* Drop other keymaps

* Correct keymap.md

* Add arrow keys to view mode

Drop C-up and C-down

Update docs for #987

Format correctly

Drop other keymaps

Correct keymap.md

Rebase

Co-authored-by: Rust & Python <nexinov@localhost.gud-o15>
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2021-11-12 09:48:37 +09:00
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>
2021-11-12 09:34:08 +09:00
Ivan Tham
9d591427be
Fix earlier/later missing changeset update (#1069)
Fix #1059
2021-11-11 22:32:44 +09:00
Omnikar
d131a9dd0e
Allow keys to be mapped to sequences of commands (#589)
* Allow keys to be mapped to sequences of commands

* Handle `Sequence` at the start of `Keymap::get`

* Use `"[Multiple commands]"` as command sequence doc

* Add command sequence example to `remapping.md`
2021-11-11 13:44:50 +09:00
Cole Helbling
bf70cfd050
helix-term/command: make scratch buffer name consistent (#1071) 2021-11-11 12:22:15 +09:00
Omnikar
ebc14d9d20
Add m textobject for pair under cursor (#961) 2021-11-11 11:33:31 +09:00
Bob
4d22454386
add wonly -- window only (#1057)
* add wonly

* Update book/src/keymap.md

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

* add `wonly` to space w mode too

* remove the TODO

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2021-11-11 11:32:23 +09:00
ath3
c7cb7527be
Fix moving with arrow keys in prompt (#1070) 2021-11-11 11:08:19 +09:00
Gokul Soumya
efc2b4c77b
Refactor keyevent handling using key, ctrl macros (#1058)
Adds ctrl! and alt! macros (which existed before the big keymap
refactor) and uses them in event handling of Components. Note
that this converts crossterm's KeyEvent to our own KeyEvent on
each invocation of handle_event in Components.
2021-11-11 00:58:46 +09:00
Gokul Soumya
e863e3b62d
Ensure that identical keymaps stay in sync (#1056)
Space mode and view mode are duplicated on two different
keybinds, and they tend to get out of sync by contributers
forgetting to update both of them. This commit adds a test
that explicitly checks that they are identical. Prevents
issues like #1050.
2021-11-11 00:58:35 +09:00
Gokul Soumya
f9e9efb3ec Check for duplicate keys in default keymap 2021-11-11 00:58:25 +09:00
Gokul Soumya
80036b8bd3 Change page keybinds in view mode
b which was assigned to page_up conflicts with
align to bottom, so this commit replaces page up,
down, etc keybinds to use normal mode keybinds
(C-f, C-b, etc) in view mode too.
2021-11-11 00:58:25 +09:00
Omnikar
5654909135
Update space w window mode (#1050) 2021-11-10 11:04:03 +09:00
Jason Hansen
cf831b1a65
Allow piping from stdin into a buffer on startup (#996)
* Allow piping from stdin into a buffer on startup

* Refactor

* Don't allow piping into new buffer on macOS

* Update helix-term/src/application.rs

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

* Update helix-term/src/application.rs

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

* Fix

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2021-11-10 10:53:14 +09:00
CossonLeo
68224232af
buffer picker add is_modifier flag (#1020) 2021-11-10 10:52:39 +09:00
Ivan Tham
97893cca64
Restore screen position when abort search (#1047) 2021-11-10 10:46:55 +09:00
Bob
7c9f620236
add <C-h>, <C-u>, <C-d>, Delete in prompt mode (#1034) 2021-11-09 14:43:50 +09:00
CossonLeo
a69caff450
search_impl will only align cursor center when it isn't in view (#959) 2021-11-09 11:11:45 +09:00
Omnikar
a424ef4e20
Use default languages.toml if user's is invalid (#994) 2021-11-09 11:07:54 +09:00
CossonLeo
29e6849413
Add LSP rename_symbol (space-r) (#1011)
improve apply_workspace_edit
2021-11-09 00:17:54 +09:00
Blaž Hrastnik
8b85903116 wip 2021-11-08 10:03:08 +09:00
Omnikar
a252ecd8c8
Add WORD textobject (#991)
* Add WORD textobject

* Document WORD textobject
2021-11-08 09:54:39 +09:00
Blaž Hrastnik
09f5796537 dap: Simplify get_breakpoint_at_current_line 2021-11-07 22:03:55 +09:00
Blaž Hrastnik
c39d9f44a0 dap: Simplify debug_parameter_prompt 2021-11-07 21:58:06 +09:00