Commit graph

1493 commits

Author SHA1 Message Date
Termina94
a17626a822
add history suggest to global search (#2717)
Co-authored-by: Dean Revell <revell@gmail.com>
2022-06-22 01:52:25 +09:00
Gokul Soumya
8e8367eea6
Refactor Margin for fine grained control (#2727) 2022-06-22 01:52:08 +09:00
ath3
ce85b9716d
Enable shellwords for Windows (with escaping disabled) (#2767) 2022-06-22 01:48:01 +09:00
Gokul Soumya
8b67acf130
Format keys identically in statusline and command palette (#2790)
The command palette previously used + as a delimiter for denoting
a single key in a key sequence, (like C+w). This was at odds with
how the statusline displayed them with pending keys (like <C-w>).
This patch changes the palette formatting to the statusline formatting
2022-06-22 01:46:50 +09:00
Gokul Soumya
8ad0b83e30 Make indent guides configurable 2022-06-21 18:43:25 +02:00
Gokul Soumya
8c4c923e80 Add indent guides support 2022-06-21 18:43:25 +02:00
Matthew Toohey
6a3f7f2c39
feat: make move_vertically aware of tabs and wide characters (#2620)
* feat: make `move_vertically` aware of tabs and wide characters

* refactor: replace unnecessary checked_sub with comparison

* refactor: leave pos_at_coords unchanged and introduce separate pos_at_visual_coords

* style: include comment to explain `pos_at_visual_coords` breaking condition

* refactor: use `pos_at_visual_coords` in `text_pos_at_screen_coords`

* feat: make `copy_selection_on_line` aware of wide characters
2022-06-22 01:36:36 +09:00
Mathspy
fa4934cff9
Default rulers color to red (#2669)
* Default rulers color to red

Currently if the theme a user is using doesn't have `ui.virtual.rulers`
set and they set up a ruler it just fails silently making it really hard
to figure out what went wrong. Did they set incorrectly set the ruler?
Are they using an outdated version of Helix that doesn't support rulers?

This happened to me today, I even switched to the default theme with
the assumption that maybe my theme just doesn't have the rulers setup
properly and it still didn't work.

Not sure if this is a good idea or not, feel free to suggest better
alternatives!

* Use builtin Style methods instead of Bevy style defaults

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* Only default the style if there's no ui or ui.virtual

* Update themes style from ui.virtual to ui.virtual.whitespace

* Revert ui.virtual change in onelight theme

* Prefer unwrap_or_else

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2022-06-22 01:35:25 +09:00
Connor Lay (Clay)
67f6c85792 text-objects: add test capture & elixir queries 2022-06-21 11:32:03 -05:00
Mathis Brossier
8c64c3dfa3
mouse selection now uses character indexing (#2839) 2022-06-20 20:41:34 +02:00
lazytanuki
55f4f69515
fix: do not color health summary when stdout is piped (#2836)
* fix: do not color health summary when stdout is piped

* fix: use crossterm instead of is-terminal
2022-06-20 17:07:32 +02:00
Gygaxis Vainhardt
debd2405d9
views -> buffers in write-all (#2788) 2022-06-16 16:09:30 -05:00
Bjorn Ove Hay Andersen
794576a5b0
Update auto-pairs and idle-timeout when the config is reloaded (#2736) 2022-06-15 22:59:58 +05:30
Frojdholm
402f285ba5
Improve markdown list rendering (#2687)
* Cleanup old commented code

* Implement line breaks in markdown rendering

* Implement markdown nested, numbered and multiparagraph lists
2022-06-15 13:20:19 +09:00
Roland Kovacs
c2cc2037b5
Better handling of symlinks (#2718)
- Add file-picker.follow-symlinks configuration option (default is true), this
  also controls if filename and directory completers follow symlinks.

- Update FilePicker to set editor error if opening a file fails, instead of
  panicing.

Fix #1548
Fix #2246
2022-06-15 13:17:17 +09:00
Ryang Sohn
3bd5545577
Add a check to prevent re-selecting same range (#2760) 2022-06-14 08:37:40 -05:00
Gokul Soumya
e9283b20b4
Add docstring for language_server!() macro (#2750) 2022-06-12 09:53:58 +09:00
Frojdholm
e0532771cc
Do not add extra line breaks in markdown lists (#2689) 2022-06-08 09:44:07 +09:00
Blaž Hrastnik
26dbdb70fb
Refactor push_jump so we're not needlessly fetching doc twice 2022-06-07 00:23:41 +09:00
Blaž Hrastnik
b14c258a2c
prompt: If submitting empty prompt, use default (last used) 2022-06-07 00:23:40 +09:00
Termina94
f1ae496860
Add shell insert commands to typable and config (#2589)
* Add shell insert commands to typable and config

* generate docs

Co-authored-by: Dean Revell <revell@gmail.com>
2022-06-05 19:52:41 +09:00
gavynriebau
b2bd87df81
Fix crash due to cycles when replaying macros (#2647)
In certain circumstances it was possible to get into an infinite loop
when replaying macros such as when different macros attempt to replay
each other.

This commit adds changes to track which macros are currently being
replayed and prevent getting into infinite loops.
2022-06-05 19:49:41 +09:00
Michael Davis
1c2aaf3baf
ensure :quit and :quit! take no arguments (#2654) 2022-06-05 19:48:16 +09:00
yzwduck
d24ca66dbb
Avoid modifying jumplist until jumping to ref (#2670)
When a goto command is cancelled, the jumplist should remain unchanged.

This commit delays saving the current selection to the jumplist until
jumping to a reference.
2022-06-05 19:44:55 +09:00
Kirawi
4f3d0a7706
append set_line_ending to document history (#2649) 2022-06-02 10:46:53 -05:00
Blaž Hrastnik
378f438fb0
fix: lsp: be more defensive about URI conversions 2022-06-02 14:07:19 +09:00
Blaž Hrastnik
6de6a3edbb
fix: lsp: be more defensive about URI conversions 2022-06-02 14:07:19 +09:00
Ryan Russell
ae12c58f0f
Improve Readability (#2639) 2022-06-01 12:01:37 -05:00
Andrey Tkachenko
fa2eeccc57
Fix unwrap error when undo after shell_append_output (#2625) 2022-05-31 23:08:16 +09:00
Blaž Hrastnik
370a16d0f0
Update to ropey 1.5 2022-05-30 12:29:07 +09:00
Blaž Hrastnik
10415a8069
Bump dependencies, allow retain_mut for now 2022-05-29 11:10:49 +09:00
dependabot[bot]
da29527258 build(deps): bump once_cell from 1.10.0 to 1.12.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.10.0 to 1.12.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.10.0...v1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-25 21:25:47 +09:00
Daniel S Poulin
0c05447d49
Add shrink equivalent of extend_to_line_bounds (#2450)
* Add shrink equivalent of extend_to_line_bounds

* Add a check for being past rope end in end position calc

* Include the EOL character in calculations

* Bind to `A-x` for now

* Document new keybind
2022-05-22 10:33:11 +09:00
kyrime
bfc4ff4dcf
Add theme key for picker separator (#2523)
Co-authored-by: ky <>
2022-05-22 10:24:51 +09:00
Leoi Hung Kin
5c864922d8
Fix panic when reloading a shrunk file (#2506)
* fix panic when reloading a shrunk file

* linting

* use scrolloff
2022-05-22 10:24:32 +09:00
Roland Kovacs
3f10473d30 Implement view swapping
* add Tree::swap_split_in_direction()
* add swap_view_{left,down,up,right} commands, bound to H,J,K,L
  respectively in the Window menu(s)
* add test for view swapping
2022-05-21 08:53:16 -05:00
Michael Davis
e04bb8b891
address rust 1.61.0 clippy lints (#2514) 2022-05-20 12:16:11 +09:00
Christoph Horn
82fb217b6a use ui.menu instead of ui.statusline for command completion menu theme 2022-05-20 10:32:59 +09:00
Robert Walter
776686ab24
Separate colors for different diagnostics types (#2437)
* feat(theme): add separate diagnostic colors

This commit adds separate diagnostic highlight colors for the different
types of LSP severities. If the severity type doesn't exist or is
unknown, we use some fallback coloring which was in use before this
commit.

Some initial color options were also added in the theme.toml

Resolves issue #2157

* feat(theme): add docs for new diagnostic options

* feat(theme): adjust defaults & reduce redundancy

- the different colors for different diagnostic severities are now
  disabled in the default theme, instead diagnostics are just generally
  underlined (as prior to the changes of this feature)
- the theme querying is now done once instead of every iteration in the
  loop of processing every diagnostic message
2022-05-20 10:30:28 +09:00
Bob
6462542fc5
support insert register in prompt (#2458)
* support insert register in prompt

* use next_char_handler instead of a flag

* Fix clippy issue

* show autoinfo when inserting register

* Revert "show autoinfo when inserting register"

This reverts commit 5488344de1c607d44bdf8693287a85b92cb32518.

* use completion instead of autoinfo

autoinfo is overlapped when using prompt

* recalculate_completion after inserting register

* Update helix-term/src/ui/prompt.rs

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

Co-authored-by: Ivan Tham <pickfire@riseup.net>
2022-05-20 10:27:59 +09:00
Roland Kovacs
8958bf0a92
Implement view transpose (#2461)
Change the layout of existing split view from horizontal to vertical and
vica-versa. It only effects the focused view and its siblings, i.e. not
recursive.

Command is mapped to 't' or 'C-t' under the Window menus.
2022-05-20 10:25:04 +09:00
Alexis Kalabura
301ed9b48f
deletion of lines affecting popup scrolling (#2497) 2022-05-20 10:18:19 +09:00
Blaž Hrastnik
7ae6cad52e
Don't panic on LSP parsing errors
This made sense initially when the implementation was still new (so we
got user reports more frequently), but a parsing error now generally
signifies a language server isn't properly implementing the spec.
2022-05-11 11:00:55 +09:00
amaihoefner
a5bc69c2b5
feat(commands): add log-open command (#2422) 2022-05-11 10:18:45 +09:00
Ivan Tham
0477d02894
Exclude cursor when doing ctrl-w (#2431)
Currently ctrl-w in insert mode deletes the cursor which results in
unexpected behavior. The patch also reduces the selection to cursor before
performing prev word to remove the behavior of removing unnecessary text
when nothing should be removed.

1. `::#(|)#::` after `ctrl-w` should be `#(|)#::`, previously `#(|)#:`
2. `#(|::)#` after `ctrl-w` should be `#(|::)#`, previously `#(|)#`

Fix #2390
2022-05-11 10:12:27 +09:00
Michael Davis
e0b5cdfb47
prevent selection collapse when inserting a newline (#2414)
Inserting a newline currently collapses any connected selections when inserting
or appending. It's happening because we're reducing the selections down to
their cursors (`let selection = ..` line) and then computing the new selection
based on the cursor. We're discarding the original head and anchor information
which are necessary to emulate Kakoune's behavior.

In Kakoune, inserting a newline retains the existing selection and _slides_
it (moves head and anchor by the same amount) forward by the newline and
indentation amount. Appending a newline extends the selection to include the
newline and any new indentation.

With the implementation of insert_newline here, we slide by adding the global
and local offsets to both head and anchor. We extend by adding the global
offset to both head and anchor but the local offset only to the head.
2022-05-11 09:53:43 +09:00
Ben Lee-Cohen
09a17e4fa3
Making the 'set-option' command help more descriptive. (#2365)
* Making the 'set-option' command help more descriptive.

* Adding the generated docs

* Making the message multi-line

* Replace newline with break in generated docs
2022-05-04 11:17:08 +09:00
Matouš Dzivjak
d2b1add1f4
feat(term): wrap command palette in overlay (#2378)
Looks better and is consistent with the rest, nothing else.
2022-05-03 17:28:41 +09:00
AntonioLucibello
ac2ea800ce
Add undo checkpoint command (#2115)
* added undo checkpoint command

* changed add_undo_checkpoint to commit_undo_checkpoint

* mapped commit_undo_checkpoint to Alt-u

* Update default.rs

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2022-05-02 23:45:20 +09:00
unrelentingtech
20162a426b
feat(commands): make it possible to disable format-on-save via the 'auto-format' option (#2321) 2022-05-02 23:31:07 +09:00