Commit Graph

634 Commits (8b789b6b864f43eae90b743ee5c5b03ccb47e717)

Author SHA1 Message Date
trivernis 8b789b6b86
Merge branch 'seperate_code_action' 2 years ago
trivernis d18a064fad
Merge branch 'colored-indent-guides' 2 years ago
Michael Davis 6cca7375ec
Automatically track pseudo-pending text (#4077)
This change automatically tracks pending text for for commands which use
on-next-key callbacks. For example, `t` will await the next key event
and "t" will be shown in the bottom right-hand corner to show that we're
in a pending state.

Previously, the text for these on-next-key commands needed to be
hard-coded into the command definition which had some drawbacks:

* It was easy to forget to write and clear the pending text.
* If a command was remapped in a custom config, the pending text would
  still show the old key.

With this change, pending text is automatically tracked based on the
key events that lead to the command being executed. This works even
when the command is remapped in config and when the on-next-key
callback is nested under some key sequence (for example `mi`).
2 years ago
A-Walrus 1d8bb2249b
Change focus to modified docs on quit (#3872)
* Change focus to modified docs on quit

When quitting with modified documents, automatically switch focus to
one of them.

* Update helix-term/src/commands/typed.rs

Co-authored-by: Poliorcetics <poliorcetics@users.noreply.github.com>

* Make it work with buffer-close-all and the like

* Cleanup

Use Cow instead of String, and rename DoesntExist -> DoesNotExist

Co-authored-by: Poliorcetics <poliorcetics@users.noreply.github.com>
2 years ago
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>
2 years ago
ath3 7c9809eeb2
Find workspace from document path (#3553) 2 years ago
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
2 years ago
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
2 years ago
Christoph Schmidler 2fac9e24e5
Inherit theme (#3067)
* Add RawTheme to handle inheritance with theme palette

* Add a intermediate step in theme loading

it uses RawTheme struct to load the original ThemePalette, so we can merge it with the inherited one.

* Load default themes via RawThemes, remove Theme deserialization

* Allow naming custom theme same as inherited one

* Remove RawTheme and use toml::Value directly

* Resolve all review changes resulting in a cleaner code

* Simplify return for Loader::load

* Add  implementation to avoid extra step for loading of base themes
2 years ago
Joe bcba5d67f9
Add goto preview (#2982) 2 years ago
Michael Davis 1daf0c35c7 Parse rainbow style array in themes
This change adds a field to the schema of themes which takes a
list of styles.

    rainbow = ["red", "orange", "yellow", { modifiers = ["reversed"] }]
    [palette]
    red = "#ff0000"
    orange = "#ffa500"
    yellow = "#fff000"

Normal style rules apply for each element in `rainbows`: you can
use definitions from the palette and the full fg/bg/modifiers
notation.

Themes written with `rainbow` keys are not backwards compatible.
Parsing errors will be generated for older versions of Helix
attempting to use themes with `rainbow` keys.

A default rainbow is provided with base16 colors.

This change is made with rainbow pair characters (parens, brackets, etc.)
in mind but it could also be used for other rainbow cosmetic elements
like rainbow indent-guides.
2 years ago
trivernis 092163bd8f
Add command to delete the file of the current buffer 2 years ago
s0LA1337 a27c384dd2 Initial implementation of colored indentation guides 2 years ago
trivernis c7492aea1f
Merge branch 'completion' 2 years ago
trivernis 1e1967308d
Merge branch 'master' 2 years ago
dependabot[bot] fd4cdf0b1f
build(deps): bump once_cell from 1.14.0 to 1.15.0 (#3987)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
trivernis 32079b7ed9
Change some default config values and default theme
Signed-off-by: trivernis <trivernis@protonmail.com>
2 years ago
trivernis 9d1d6a74ec
Merge remote-tracking branch 'tree-explorer-icons/tree_explorer_icons' 2 years ago
Roland Singer 3d987c0703 removed match 2 years ago
Roland Singer 8f43b1f6e9 Merge branch 'tree_explore' of https://github.com/cossonfork/helix into tree_explorer 2 years ago
trivernis beeca2d823
Merge branch 'master' of github.com:helix-editor/helix 2 years ago
Michael Davis 8988c1ecc7
Re-sort diagnostics after transaction transform (#3895)
Applying document-change transactions to diagnostic ranges is not stable
with respect to the ordering of diagnostics. This can cause diagnostics
to become temporarily unordered with some edits to a document, which can
eventually break some invariants/assumptions in syntax::merge.

With this change, Document::diagnostics are always sorted.
2 years ago
trivernis 2da81760f5
Merge branch 'master' of github.com:helix-editor/helix 2 years ago
trivernis 388181bab7
Merge branch 'master' of github.com:helix-editor/helix 2 years ago
cossonleo aec001ad84 completion fix 2 years ago
A-Walrus 75e6a64327 Switch to Result for invalid language 2 years ago
A-Walrus e8add6f46d Add error handling to set language command
If you type a nonexistant language an appropriate message will show,
and the language won't be changed.
2 years ago
Blaž Hrastnik a123fb6057
Remove LspNotDefined, instead return an Option<> 2 years ago
A-Walrus fe37a66046
Handle formatter errors, and save anyway (#3684)
If formatting fails, report error to log and save without formatting.
2 years ago
dependabot[bot] 5e1296b888
build(deps): bump once_cell from 1.13.1 to 1.14.0 (#3715)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
trivernis c24c30584b
Merge branch 'master' of github.com:helix-editor/helix 2 years ago
Michael Davis f0d1caafcf
Look for the external formatter before invoking it (#3670)
Currently it is not possible to save a file with a language that
has an external formatter configuration unless the external
formatter is installed, even if the language has a Language Server
configuration capable of auto-format. This change checks that the
external formatter exists before using it to create a formatting
callback.
2 years ago
A-Walrus c93d52cc8a
Fix cargo doc warnings, and add GitHub action to ensure it (#3650) 2 years ago
Blaž Hrastnik 6ec4017a8d
Expand doc/view macros to allow fetching specific id
This simplifies the code and hides away unwraps
2 years ago
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>
2 years ago
A-Walrus 45dbcb6783
Fix closing buffer with custom keymap (#3633)
* Fix closing buffer with custom keymap

* Add comment explaining if
2 years ago
Blaž Hrastnik 5c2b77b41f
Make mode editor-wide rather than per-document 2 years ago
Blaž Hrastnik 12ddd03d3b
fix: Don't translate mouse up events as down 2 years ago
PiergiorgioZagaria d2cec25395
Fix process spawning error handling (#3349)
* Fix process spawning error handling

* Log stderr in any case
2 years ago
Michael Davis 5f043dde56
Derive Document language name from languages.toml name key (#3338)
* Derive Document language name from `languages.toml` `name` key

This changes switches from deriving the language name from the
`languages.toml` `scope` key to `name` (`language_id` in the
`LanguageConfiguration` type). For the most part it works to derive the
language name from scope by chopping off `source.` or `rsplit_once` on
`.` but for some languages we have now like html (`text.html.basic`),
it doesn't. This also should be a more accurate fallback for the
`language_id` method which is used in LSP and currently uses the
`rsplit_once` strategy.

Here we expose the language's name as `language_name` on `Document` and
replace ad-hoc calculations of the language name with the new method.

This is most impactful for the `file-type` statusline element which is
using `language_id`.

* Use `Document::language_name` for the `file-type` statusline element

The `file-type` indicator element in the statusline was using
`Document::language_id` which is meant to be used to for telling
Language Servers what language we're using. That works for languages
with `language-server` configurations in `languages.toml` but shows
text otherwise. The new `Document::language_name` method from the
parent commit is a more accurate way to determine the language.
2 years ago
A-Walrus ae81fbdbf6
Allow less than and greater than in macros (#3556)
* Allow less than and greater than in macros

* Fix failing test
2 years ago
Charlie Groves f38ede8631
Add bracketed paste (#3233) 2 years ago
unrelentingtech 51b62230da
Add wezterm to get_terminal_provider (#3588)
https://github.com/wez/wezterm is a terminal emulator with its own built-in multiplexer
2 years ago
cossonleo 0e04c4c93c tree helper and file explorer 2 years ago
trivernis 151ac52741
Merge branch 'master' of github.com:helix-editor/helix 2 years ago
Blaž Hrastnik e4c9d4082a
fix: Reset document mode when losing focus
Fixes #3090
2 years ago
Blaž Hrastnik 7b8e4ac95a
Editor: remove duplication for view focus/swap commands 2 years ago
Charlie Groves 18909aafe2
Update to crossterm-0.25 (#3390) 2 years ago
Blaž Hrastnik d993c6349b
One more windows fix... 2 years ago
Blaž Hrastnik e863f6fe27
Fix compilation on windows 2 years ago