1
0
mirror of https://github.com/helix-editor/helix synced 2024-11-10 10:34:45 +01:00
A post-modern modal text editor. https://helix-editor.com
Go to file
Clément Delafargue 8dd1ab4899
Softwrapping improvements (#5893)
* use max_line_width + 1 during softwrap to account for newline char

Helix softwrap implementation always wraps lines so that the newline
character doesn't get cut off so he line wraps one chars earlier then
in other editors. This is necessary, because newline chars are always
selecatble in helix and must never be hidden.

However That means that `max_line_width` currently wraps one char
earlier than expected. The typical definition of line width does not
include the newline character and other helix commands like `:reflow`
also don't count the newline character here.

This commit makes softwrap use `max_line_width + 1` instead of
`max_line_width` to correct the impedance missmatch.

* fix typos

Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>

* Add text-width to config.toml

* text-width: update setting documentation

* rename leftover config item

* remove leftover max-line-length occurrences

* Make `text-width` optional in editor config

When it was only used for `:reflow` it made sense to have a default
value set to `80`, but now that soft-wrapping uses this setting, keeping
a default set to `80` would make soft-wrapping behave more aggressively.

* Allow softwrapping to ignore `text-width`

Softwrapping wraps by default to the viewport width or a configured
`text-width` (whichever's smaller). In some cases we only want to set
`text-width` to use for hard-wrapping and let longer lines flow if they
have enough space. This setting allows that.

* Revert "Make `text-width` optional in editor config"

This reverts commit b247d526d69adf41434b6fd9c4983369c785aa22.

* soft-wrap: allow per-language overrides

* Update book/src/configuration.md

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update book/src/languages.md

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update book/src/configuration.md

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

---------

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
Co-authored-by: Alex Boehm <alexb@ozrunways.com>
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2023-03-08 11:02:11 +09:00
.cargo
.github
book Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
contrib
docs
helix-core Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
helix-dap
helix-loader
helix-lsp Handle snippets for LSPs not providing offsets for completion 2023-03-08 10:48:35 +09:00
helix-parsec Remove now unused the pattern combinator 2023-03-08 10:48:35 +09:00
helix-term Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
helix-tui tui: Log keyboard enhancement query time 2023-03-08 10:49:32 +09:00
helix-vcs Add command for resetting diff hunks (#5736) 2023-03-08 10:49:14 +09:00
helix-view Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
runtime Update highlights for golang (#6204) 2023-03-07 18:33:13 -06:00
xtask
.envrc
.gitattributes
.gitignore
.ignore
base16_theme.toml
Cargo.lock tui: Cache the keyboard enhancement check 2023-03-08 10:49:32 +09:00
Cargo.toml Add a parser-combinator crate 2023-03-08 10:48:35 +09:00
CHANGELOG.md
default.nix
flake.lock
flake.nix
grammars.nix
languages.toml Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
LICENSE
logo_dark.svg
logo_light.svg
logo.svg
README.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
rust-toolchain.toml
rustfmt.toml
screenshot.png
shell.nix
theme.toml
VERSION

Helix

Build status GitHub Release Documentation GitHub contributors Matrix Space

Screenshot

A Kakoune / Neovim inspired editor, written in Rust.

The editing model is very heavily based on Kakoune; during development I found myself agreeing with most of Kakoune's design decisions.

For more information, see the website or documentation.

All shortcuts/keymaps can be found in the documentation on the website.

Troubleshooting

Features

  • Vim-like modal editing
  • Multiple selections
  • Built-in language server support
  • Smart, incremental syntax highlighting and code editing via tree-sitter

It's a terminal-based editor first, but I'd like to explore a custom renderer (similar to Emacs) in wgpu or skulpin.

Note: Only certain languages have indentation definitions at the moment. Check runtime/queries/<lang>/ for indents.scm.

Installation

Installation documentation.

Packaging status

Contributing

Contributing guidelines can be found here.

Getting help

Your question might already be answered on the FAQ.

Discuss the project on the community Matrix Space (make sure to join #helix-editor:matrix.org if you're on a client that doesn't support Matrix Spaces yet).

Credits

Thanks to @JakeHL for designing the logo!