1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-05-18 03:06:05 +02:00
Commit Graph

75 Commits

Author SHA1 Message Date
Skyler Hawthorne 06d095f31c provide option to completely disable lsp 2023-02-02 14:53:18 -05:00
Pascal Kuthe 6ed2348078
Hide duplicate symlinks from the picker (#5658)
* hide duplicate symlinks from the picker

* Apply suggestions from code review

Co-authored-by: g-re-g <123515925+g-re-g@users.noreply.github.com>

* minor stylistic fix

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

---------

Co-authored-by: g-re-g <123515925+g-re-g@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-02-02 11:14:02 -06:00
Pascal Kuthe 4dcf1fe66b
rework positioning/rendering and enable softwrap/virtual text (#5420)
* rework positioning/rendering, enables softwrap/virtual text

This commit is a large rework of the core text positioning and
rendering code in helix to remove the assumption that on-screen
columns/lines correspond to text columns/lines.

A generic `DocFormatter` is introduced that positions graphemes on
and is used both for rendering and for movements/scrolling.
Both virtual text support (inline, grapheme overlay and multi-line)
and a capable softwrap implementation is included.

fix picker highlight

cleanup doc formatter, use word bondaries for wrapping

make visual vertical movement a seperate commnad

estimate line gutter width to improve performance

cache cursor position

cleanup and optimize doc formatter

cleanup documentation

fix typos

Co-authored-by: Daniel Hines <d4hines@gmail.com>

update documentation

fix panic in last_visual_line funciton

improve soft-wrap documentation

add extend_visual_line_up/down commands

fix non-visual vertical movement

streamline virtual text highlighting, add softwrap indicator

fix cursor position if softwrap is disabled

improve documentation of text_annotations module

avoid crashes if view anchor is out of bounds

fix: consider horizontal offset when traslation char_idx -> vpos

improve default configuration

fix: mixed up horizontal and vertical offset

reset view position after config reload

apply suggestions from review

disabled softwrap for very small screens to avoid endless spin

fix wrap_indicator setting

fix bar cursor disappearring on the EOF character

add keybinding for linewise vertical movement

fix: inconsistent gutter highlights

improve virtual text API

make scope idx lookup more ergonomic

allow overlapping overlays

correctly track char_pos for virtual text

adjust configuration

deprecate old position fucntions

fix infinite loop in highlight lookup

fix gutter style

fix formatting

document max-line-width interaction with softwrap

change wrap-indicator example to use empty string

fix: rare panic when view is in invalid state (bis)

* Apply suggestions from code review

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

* improve documentation for positoning functions

* simplify tests

* fix documentation of Grapheme::width

* Apply suggestions from code review

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

* add explicit drop invocation

* Add explicit MoveFn type alias

* add docuntation to Editor::cursor_cache

* fix a few typos

* explain use of allow(deprecated)

* make gj and gk extend in select mode

* remove unneded debug and TODO

* mark tab_width_at #[inline]

* add fast-path to move_vertically_visual in case softwrap is disabled

* rename first_line to first_visual_line

* simplify duplicate if/else

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-02-01 02:03:19 +09:00
Doug Kelkhoff 2b58ff4d7c
Add configuration for min width of line-numbers gutter (#4724) 2023-01-21 14:20:59 -06:00
Clément Delafargue 7bdba4a6bf doc: add missing `whitespace.render` sub-key 2023-01-16 10:02:15 -06:00
Nick c9ed42cdec
Add a status line element that shows just the basename of the file (#5318) 2022-12-31 08:18:14 -06:00
Pascal Kuthe 5a3ff74221
Show (git) diff signs in gutter (#3890)
* Show (git) diff signs in gutter (#3890)

Avoid string allocation when git diffing

Incrementally diff using changesets

refactor diffs to be provider indepndent and improve git implementation

remove dependency on zlib-ng

switch to asynchronus diffing with similar

Update helix-vcs/Cargo.toml

fix toml formatting

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

fix typo in documentation

use ropey reexpors from helix-core

fix crash when creating new file

remove useless use if io::Cursor

fix spelling mistakes

implement suggested improvement to repository loading

improve git test isolation

remove lefover comments

Co-authored-by: univerz <univerz@fu-solution.com>

fixed spelling mistake

minor cosmetic changes

fix: set self.differ to None if decoding the diff_base fails

fixup formatting

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

reload diff_base when file is reloaded from disk

switch to imara-diff

Fixup formatting

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

Redraw buffer whenever a diff is updated.

Only store hunks instead of changes for individual lines to easily allow
jumping between them

Update to latest gitoxide version

Change default diff gutter position

Only update gutter after timeout

* update diff gutter synchronously, with a timeout

* Apply suggestions from code review

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* address review comments and ensure lock is always aquired

* remove configuration for redraw timeout

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2022-12-01 17:35:23 +09:00
Gaurav Tyagi 91ff903bf3
Add global error/warning count statusline element (#4569) 2022-11-14 19:46:07 -06:00
wes adams fd585c1ee4
Statusline indicator to show number of selected chars (#4682)
Co-authored-by: wes adams <wadams@grayshift.com>
2022-11-12 11:31:09 -06:00
Doug Kelkhoff 7ed9e9cf25
Dynamically resize line number gutter width (#3469)
* dynamically resize line number gutter width

* removing digits lower-bound, permitting spacer

* removing max line num char limit; adding notes; qualified successors; notes

* updating tests to use new line number width when testing views

* linenr width based on document line count

* using min width of 2 so line numbers relative is useful

* lint rolling; removing unnecessary type parameter lifetime

* merge change resolution

* reformat code

* rename row_styler to style; add int_log resource

* adding spacer to gutters default; updating book config entry

* adding view.inner_height(), swap for loop for iterator

* reverting change of current! to view! now that doc is not needed
2022-11-08 21:19:59 +09:00
Charlie Groves 7e29ee6dae
Autosave all when the terminal loses focus (#3178)
* Autosave all when the terminal loses focus

* Correct comment on focus config

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

* Need a block_try_flush_writes in all quit_all paths

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2022-10-21 10:35:02 +09:00
Sumit Sahrawat a079f2c9bd
Add some vertical characters to the editor.indent-guides documentation (#4163)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2022-10-10 16:23:14 -05:00
A-Walrus c15f1ea274
Add cursorcolumn (#4084)
* Implement cursorcolumn

* Add documentation

* Separate column style from line with fallback

* Fallback to cursorcolumn first

* Switch to non-fallback try_get_exact

Add new function `try_get_exact`, which doesn't perform fallback,
and use that instead because the fallback behaviour is being handled
manually.
2022-10-09 03:28:42 +09:00
Brandon Dong 18cfe864f4
Fix incorrect scrolloff default in documentation (#4136) 2022-10-08 03:22:35 +09:00
Karsten Gebbert 9124c231f4
respond to SIGUSR1 by reloading config (#3952)
* respond to SIGUSR1 by reloading config

* document USR1 signal handling
2022-10-04 00:08:32 +09:00
Robin 6764744ce9
Add option to skip the first indent guide (#3819)
* Add option to skip the first indent guide

* reorder skip_first option

* change indent-guides.skip_first to a number

* rename skip -> skip_levels

* add skip_levels to the book

* Update book/src/configuration.md

Co-authored-by: A-Walrus <58790821+A-Walrus@users.noreply.github.com>

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

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

Co-authored-by: Robin <robinvandijk@klippa.com>
Co-authored-by: A-Walrus <58790821+A-Walrus@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2022-10-04 00:07:04 +09:00
Joshua Pauline c144cc0b04
feat(statusline): add option to show total line numbers in file (#3960)
* feat(statusline): add option to show total line numbers in file

* feat(line numbers): add config to doc book
2022-10-03 23:54:00 +09:00
PeepNSheep 77f33e7b20
Add configureable statusline mode names (#3311)
* Added 'long-mode' statusline element

* Added customizable statusline mode names

* Removed a string clone

* Added documentation

* Updated documentation, moved modenames to a seperate section

* Update configuration.md

* Documentation update

* Documentation update

* Documentation update

* Update configuration.md

* Update configuration.md

* Fixed merge error

* Update configuration.md

* Update configuration.md
2022-10-03 23:45:32 +09:00
aaron404 e8730ca5fd
initial implementation of bufferline (#2759)
* initial implementation of bufferline

* fixed lint

* changed to 'bufferline', added enum for config modes, some cleanup

* fixed lint

* added file modification indicator

* removed redundant code, added proper themeing with fallback, changed 'file modified' indicator

* remove commented code

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

simplify text and offset computation

Co-authored-by: Gokul Soumya <gokulps15@gmail.com>

* add ui.bufferline.background key for themes

Co-authored-by: lazytanuki <43273245+lazytanuki@users.noreply.github.com>

* address PR comments

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

* simplify computation of editor area:

* change to set_stringn to avoid overflow

* Update configuration.md

Updates documentation to reflect decision re: defaulting to never showing bufferline.

* addressed pr comments

* fix build error

* address pr comments

* revert accidental change

Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
Co-authored-by: lazytanuki <43273245+lazytanuki@users.noreply.github.com>
Co-authored-by: Seth Bromberger <sbromberger@users.noreply.github.com>
2022-09-02 11:39:38 +09:00
A-Walrus ed74e6d5d4
Switch to `tabpad` configuration option (#3458)
Virtual whitespace tabs are created from the `tab` character padded
with `tabpad` up to  the tab width.
2022-08-21 13:54:02 +09:00
Manuel Schmidbauer 8a75795472
Improved file-picker configuration documentation (#3422) 2022-08-14 13:36:08 -05:00
Michael Davis 5d33dbacac
add a CLI flag for specifying config file location (#2666) 2022-08-04 13:05:52 +09:00
Seth Bromberger 846a6b65c3
add configurable / theme-able statusline separator string (#3175)
* add configurable separator element to statusline

* themable separator

* clippy fixes

* changed default separator to │

* doc updates
2022-07-27 08:47:22 +09:00
Seth Bromberger 3dd2196e4f
add position-percentage as a statusline indicator (#3168)
* added position-pct as a statusline indicator

* removed unnecessary mutable reference

* pct -> percent

* percent -> percentage
2022-07-26 15:05:12 +09:00
Blaž Hrastnik 255c1734cf
Rename padding to spacer, remove by default 2022-07-26 10:10:06 +09:00
Ivan Tham 2f980471f8
Make gutters padding automatic (#3163)
Remove padding gutter type, and automatically add 1 padding if gutters is
non-empty.
2022-07-26 10:08:09 +09:00
Seth Bromberger bfdcfec8c9
add spacer element to statusline (#3165)
* add spacer element to statusline

* docs
2022-07-26 10:07:59 +09:00
Alexis Kalabura 8b2a14153b
add statusline element to display file line endings (#3113)
* add statusline element to display file line endings

* run cargo fmt --all

* change the word *ending* from plural to singular

* support for the unicode-lines feature flag
2022-07-21 13:03:12 +09:00
Gokul Soumya 791bf7e50a
Add lsp signature help (#1755)
* Add lsp signature help

* Do not move signature help popup on multiple triggers

* Highlight current parameter in signature help

* Auto close signature help

* Position signature help above to not block completion

* Update signature help on backspace/insert mode delete

* Add lsp.auto-signature-help config option

* Add serde default annotation for LspConfig

* Show LSP inactive message only if signature help is invoked manually

* Do not assume valid signature help response from LSP

Malformed LSP responses are common, and these should not crash the
editor.

* Check signature help capability before sending request

* Reuse Open enum for PositionBias in popup

* Close signature popup and exit insert mode on escape

* Add config to control signature help docs display

* Use new Margin api in signature help

* Invoke signature help on changing to insert mode
2022-07-19 11:28:24 +09:00
Ivan Tham e8214fb1e6
Make gutters padding optional (#2996)
If all gutters are removed, there are still an extra one padding, would be nice
to remove that to save some space.
2022-07-18 10:13:47 +09:00
Mr. E dbf68e0370
Customizable/configurable status line (#2434)
* feat(statusline): add the file type (language id) to the status line

* refactor(statusline): move the statusline implementation into an own struct

* refactor(statusline): split the statusline implementation into different functions

* refactor(statusline): Append elements using a consistent API

This is a preparation for the configurability which is about to be
implemented.

* refactor(statusline): implement render_diagnostics()

This avoid cluttering the render() function and will simplify
configurability.

* feat(statusline): make the status line configurable

* refactor(statusline): make clippy happy

* refactor(statusline): avoid intermediate StatusLineObject

Use a more functional approach to obtain render functions and write to
the buffers, and avoid an intermediate StatusLineElement object.

* fix(statusline): avoid rendering the left elements twice

* refactor(statusline): make clippy happy again

* refactor(statusline): rename `buffer` into `parts`

* refactor(statusline): ensure the match is exhaustive

* fix(statusline): avoid an overflow when calculating the maximal center width

* chore(statusline): Describe the statusline configurability in the book

* chore(statusline): Correct and add documentation

* refactor(statusline): refactor some code following the code review

Avoid very small helper functions for the diagnositcs and inline them
instead.
Rename the config field `status_line` to `statusline` to remain
consistent with `bufferline`.

* chore(statusline): adjust documentation following the config field refactoring

* revert(statusline): revert regression introduced by c0a1870

* chore(statusline): slight adjustment in the configuration documentation

* feat(statusline): integrate changes from #2676 after rebasing

* refactor(statusline): remove the StatusLine struct

Because none of the functions need `Self` and all of them are in an own
file, there is no explicit need for the struct.

* fix(statusline): restore the configurability of color modes

The configuration was ignored after reintegrating the changes of #2676
in 8d28f95.

* fix(statusline): remove the spinner padding

* refactor(statusline): remove unnecessary format!()
2022-07-18 09:57:01 +09:00
Alex Kim bcacc703d7
fix wrong value for cursor shape config in the docs (#3081) 2022-07-15 20:21:34 +05:30
Mathspy d06800f1dd
Add mode specific styles (#2676)
* Add mode specific styles

In similar vein to neovim's lualine and similar statusline packages this
allows helix users to style their mode based on which mode it is thus
making each mode more visually distinct at a glance

* Add an example based on rosepine

* Add editor.colors-mode config

* Document statusline mode styles
2022-06-30 18:26:00 +09:00
Tobias Menzi 8dc86beabd
Implement cursorline (#2170)
* Implement cursorline

* Binary search possible lines
2022-06-27 17:09:34 +09:00
Gokul Soumya 8ad0b83e30 Make indent guides configurable 2022-06-21 18:43:25 +02:00
Michael Davis f59b3b91c8
rewrite auto-pairs docs (#2384) 2022-05-04 11:16:34 +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
unrelentingtech 2c60798b00
feat(ui): add nbsp (non-breaking space) to rendered whitespace (#2322) 2022-04-30 09:48:52 +09:00
chunghha 3a398eec56
fix typos (#2304) 2022-04-27 14:21:20 -05:00
Omnikar e6b865ed0b allow whitespace to be rendered
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2022-04-20 11:37:23 +09:00
Thomas 5d5b6bab9b
Add rulers option (#2060)
* Add color_column option

* Rename to ruler

Co-authored-by: DeviousStoat <devious@stoat.com>
2022-04-20 10:44:32 +09:00
Dr. David A. Kunz b04c425c63
Make gutters configurable (#1967)
* config option line numbers none

* view tests

* added tests

* doc

* comment

* Make gutters configurable

* docu

* docu

* rm none docu

* order

* order

* precedence

* simpler

* rm todo

* fixed clippy

* order

* double quotes

* only allow diagnostics and line-numbers

* tests

* docu

* format

* rm short variant and more docu

* performance improvements

* typo

* rename
2022-04-16 10:41:25 +09:00
scgtrp 740f565c80
Document values for editor.cursor-shape (#2094)
These are hinted at in the example config at the top (except `none`), but really should be listed explicitly near the option itself for clarity.
2022-04-13 13:00:17 +09:00
Gokul Soumya 7b3a3d562c
Move top level lsp config to editor.lsp (#1868)
* Move top level lsp config to editor.lsp

This is mainly done to accomodate the new lsp.signature-help config
option that will be introduced in https://github.com/helix-editor/helix/pull/1755
which will have to be accessed by commands. The top level config
struct is split and moved to different places, making the relocation
necessary

* Revert rebase slipup
2022-03-28 10:11:52 +09:00
Joe bee05dd32a
Add refresh-config and open-config command (#1803)
* Add refresh-config and open-config command

* clippy

* Use dynamic dispatch for editor config

* Refactor Result::Ok to Ok

* Remove unused import

* cargo fmt

* Modify config error handling

* cargo xtask docgen

* impl display for ConfigLoadError

* cargo fmt

* Put keymaps behind dyn access, refactor config.load()

* Update command names

* Update helix-term/src/application.rs

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

* Switch to unbounded_channel

* Remove --edit-config command

* Update configuration docs

* Revert "Put keymaps behind dyn access", too hard

This reverts commit 06bad8cf49.

* Add refresh for keys

* Refactor default_keymaps, fix config default, add test

* swap -> store, remove unneeded clone

* cargo fmt

* Rename default_keymaps to default

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2022-03-25 18:05:20 +09:00
Michael Davis 8081e9f052 replace all submodule documentation with flags documentation 2022-03-10 17:31:57 +09:00
Joe 8d7a25b4d4
Add --edit-config flag to directly open config.toml (#1771)
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
2022-03-10 00:04:12 +05:30
Philipp Mildenberger 7bb1db3ab5
Bring configuration documentation up to date (missing editor.search section) (#1719) 2022-03-01 10:06:14 +09:00
Skyler Hawthorne a494f47a5d
Configurable auto pairs (#1624)
* impl auto pairs config

Implements configuration for which pairs of tokens get auto completed.

In order to help with this, the logic for when *not* to auto complete
has been generalized from a specific hardcoded list of characters to
simply testing if the next/prev char is alphanumeric.

It is possible to configure a global list of pairs as well as at the
language level. The language config will take precedence over the
global config.

* rename AutoPair -> Pair

* clean up insert_char command

* remove Rc

* remove some explicit cloning with another impl

* fix lint

* review comments

* global auto-pairs = false takes precedence over language settings

* make clippy happy

* print out editor config on startup

* move auto pairs accessor into Document

* rearrange auto pair doc comment

* use pattern in Froms
2022-02-25 17:36:54 +09:00
Andrew Neth 333c2949c2
feat(helix-view): dynamic line numbers (#1522)
* feat(helix-view): dynamic line numbers

* docs: describe editor.line-number in more detail

* Make dynamic numbers the default behavior of `relative`
2022-01-26 00:18:01 +09:00