aboutsummaryrefslogtreecommitdiff
path: root/helix-view
Commit message (Collapse)AuthorAge
...
* Customizable/configurable status line (#2434)Mr. E2022-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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!()
* Add live preview to theme picker (#1798)Joe2022-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add theme picker with live preview * Add live theme preview to :theme command * cargo fmt * Fix clippy warnings * Remove picker variant * Remove unused import * Cleanup * Change current_theme to last_theme * Fix accidental comment flash deletion * Typo * Remove theme cache * Add some comments * Refactor some theme handling TIL flatmap on Option is called and_then * Remove unnecessary renames * Constrain last_theme theme preview lifecycle * Switch to bitflag implementation * Better handling of last_theme * Sort theme names * Better memory juggling * Missed a branch * Remove name from theme, switch bitand to & * cargo fmt * Update helix-view/src/editor.rs * Switch boolean to enum * Remove bitflag impl * cargo fmt * Remove un-needed type arg * cargo fmt
* build(deps): bump crossterm from 0.23.0 to 0.24.0 (#2968)dependabot[bot]2022-07-05
| | | | | | | | | | | | | | | | | Bumps [crossterm](https://github.com/crossterm-rs/crossterm) from 0.23.0 to 0.24.0. - [Release notes](https://github.com/crossterm-rs/crossterm/releases) - [Changelog](https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md) - [Commits](https://github.com/crossterm-rs/crossterm/compare/0.23...0.24) --- updated-dependencies: - dependency-name: crossterm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump once_cell from 1.12.0 to 1.13.0 (#2969)dependabot[bot]2022-07-05
| | | | | | | | | | | | | | | | | Bumps [once_cell](https://github.com/matklad/once_cell) from 1.12.0 to 1.13.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.12.0...v1.13.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> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add mode specific styles (#2676)Mathspy2022-06-30
| | | | | | | | | | | | | * 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
* Add workspace and document diagnostics picker (#2013)Falco Hirschenberger2022-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add workspace and document diagnostics picker fixes #1891 * Fix some of @archseer's annotations * Add From<&Spans> impl for String * More descriptive parameter names. * Adding From<Cow<str>> impls for Span and Spans * Add new keymap entries to docs * Avoid some clones * Fix api change * Update helix-term/src/application.rs Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com> * Fix a clippy hint * Sort diagnostics first by URL and then by severity. * Sort diagnostics first by URL and then by severity. * Ignore missing lsp severity entries * Add truncated filepath * Typo * Strip cwd from paths and use url-path without schema * Make tests a doctest * Better variable names Co-authored-by: Falco Hirschenberger <falco.hirschenberger@itwm.fraunhofer.de> Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com>
* Implement cursorline (#2170)Tobias Menzi2022-06-27
| | | | | * Implement cursorline * Binary search possible lines
* Merge pull request #2359 from dead10ck/test-harnessBlaž Hrastnik2022-06-21
|\ | | | | Integration testing harness
| * Merge branch 'master' into test-harnessBlaž Hrastnik2022-06-21
| |\
| * | Add more context; Editor::open doesn't need to own pathSkyler Hawthorne2022-06-19
| | |
| * | tests for buffer-closeSkyler Hawthorne2022-06-19
| | |
| * | tests for serialized writesSkyler Hawthorne2022-06-19
| | |
| * | Fix initial selection of Document in new viewSkyler Hawthorne2022-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a new View of a Document is created, a default cursor of 0, 0 is created, and it does not get normalized to a single width cursor until at least one movement of the cursor happens. This appears to have no practical negative effect that I could find, but it makes tests difficult to work with, since the initial selection is not what you expect it to be. This changes the initial selection of a new View to be the width of the first grapheme in the text.
| * | improve test harnessSkyler Hawthorne2022-06-19
| | | | | | | | | | | | | | | | | | | | | * Use new macro syntax for encoding sequences of keys * Make convenience helpers for common test pattern * Use indoc for inline indented raw strings * Add feature flag for integration testing to disable rendering
* | | add history suggest to global search (#2717)Termina942022-06-21
| | | | | | | | | Co-authored-by: Dean Revell <revell@gmail.com>
* | | Refactor Margin for fine grained control (#2727)Gokul Soumya2022-06-21
| | |
* | | Format keys identically in statusline and command palette (#2790)Gokul Soumya2022-06-21
| | | | | | | | | | | | | | | | | | 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
* | | Make indent guides configurableGokul Soumya2022-06-21
| |/ |/|
* | feat: make `move_vertically` aware of tabs and wide characters (#2620)Matthew Toohey2022-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Display highest severity diagnostic in gutter (#2835)A-Walrus2022-06-21
|/ | | | | | | | | | * Display highest severity diagnostic in gutter * Improve gutter diagnostic performance Very slight improvement (doesn't really make a difference), iterates over the diagnostics of the line once instead of twice. * Add comment justifying unwrap
* simplify some keymap key names follow up tests (#2694)Henry2022-06-17
|
* Update auto-pairs and idle-timeout when the config is reloaded (#2736)Bjorn Ove Hay Andersen2022-06-15
|
* Better handling of symlinks (#2718)Roland Kovacs2022-06-15
| | | | | | | | | | - 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
* simplify fallback for selected line-number theming (#2768)Michael Davis2022-06-14
|
* minor: Simplify Document.language_id()Blaž Hrastnik2022-06-06
|
* simplify some keymap key names (#2677)Henry2022-06-06
|
* Passing extra formatting options to LSPs (#2635)farwyler2022-06-05
| | | | | | | | | | | | | * allows passing extra formatting options to LSPs - adds optional field 'format' to [[language]] sections in 'languages.toml' - passes specified options the LSPs via FormattingOptions * cleaner conversion of formatting properties * move formatting options inside lsp::Client * cleans up formatting properties merge
* Fix crash due to cycles when replaying macros (#2647)gavynriebau2022-06-05
| | | | | | | | 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.
* Fix panic on close last buffer (#2367) (#2658)gavynriebau2022-06-05
| | | | | | | | | | | | | | * Fix panic on close last buffer (#2367) In certain circumstances it was possible to cause a panic when closing buffers due to some mishandling of view document history. A change has been made to delete removed documents from the history of accessed documents for each view. The ensures we don't attempt to jump to a deleted document by mistake. * Move remove document code into View function 'remove_document' * Replace 'view.jumps.remove' call with 'view.remove_document' call
* Improve Readability (#2639)Ryan Russell2022-06-01
|
* fix: Remove empty scratch buffer from jumplists when removing itBlaž Hrastnik2022-05-29
| | | | Fixes #1238
* build(deps): bump once_cell from 1.10.0 to 1.12.0dependabot[bot]2022-05-25
| | | | | | | | | | | | | | | 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>
* lower MSRV to 1.57.0Michael Davis2022-05-23
| | | | | | | | This line uses the Display trait for io::ErrorKind which was stabilized in Rust 1.60.0. We can set MSRV all the way back to 1.57.0 by replacing it with a pretty-print. Closes #2460.
* Move Tree nodes on view swapRoland Kovacs2022-05-21
| | | | | Instead of moving the Node contents on view swap if they have the same parent reorder them to keep traversal order otherwise re-parent them.
* Implement view swappingRoland Kovacs2022-05-21
| | | | | | | * 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
* Implement view transpose (#2461)Roland Kovacs2022-05-20
| | | | | | | 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.
* Run debug console in windows (#2294)Alexis Kalabura2022-05-11
|
* prefer Document::set_selection to inserting selections directly (#2411)Michael Davis2022-05-11
| | | | | | | | | | | | | | | | | | | Inserting these with the `HashMap::insert` method evades the call to `Selection::ensure_invariants`. The effect is that the scratch buffer (or other buffers opened through these code-paths) can start with a selection at (0, 0), when a file with equivalent contents ("\n") would start with (0, 1). I.e.: hx and touch f hx f start with different selections even though they have an equivalent Rope. With this change they both start with (0, 1).
* cfg-gate unused functions on macos & windows (#2332)Kirawi2022-05-02
|
* feat(commands): make it possible to disable format-on-save via the ↵unrelentingtech2022-05-02
| | | | 'auto-format' option (#2321)
* Add a nop clipboard provider for wasmBlaž Hrastnik2022-05-01
|
* feat(ui): add nbsp (non-breaking space) to rendered whitespace (#2322)unrelentingtech2022-04-30
|
* fix typos (#2304)chunghha2022-04-27
|
* feat(commands): better handling of buffer-close (#1397)Matouš Dzivjak2022-04-27
| | | | | | | | | | | | | | | | | | | * feat(commands): better handling of buffer-close Previously, when closing buffer, you would loose cursor position in other docs. Also, all splits where the buffer was open would be closed. This PR changes the behavior, if the view has also other buffer previously viewed it switches back to the last one instead of the view being closed. As a side effect, since the views are persisted, the cursor history is persisted as well. Fixes: https://github.com/helix-editor/helix/issues/1186 * Adjust buffer close behavior * Remove closed documents from jump history * Fix after rebase
* allow whitespace to be renderedOmnikar2022-04-20
| | | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Add rulers option (#2060)Thomas2022-04-20
| | | | | | | * Add color_column option * Rename to ruler Co-authored-by: DeviousStoat <devious@stoat.com>
* Make gutters configurable (#1967)Dr. David A. Kunz2022-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix panic when using set-language on a scratch (#1996)Roland Kovacs2022-04-13
| | | Skip launching a language server if a document doesn't have a valid URL.
* Add `:write!` to create nonexistent subdirectories (#1839)Omnikar2022-04-12
| | | | | | | * Make `:write` create nonexistent subdirectories Prompting as to whether this should take place remains a TODO. * Move subdirectory creation to new `w!` command
* Add runtime language configuration (#1794) (#1866)Roland Kovacs2022-04-05
| | | | | | | | | | | | | | | | | | | | | * Add runtime language configuration (#1794) * Add set-language typable command to change the language of current buffer. * Add completer for available language options. * Update set-language to refresh language server as well * Add language id based config lookup on `syntax::Loader`. * Add `Document::set_language3` to set programming language based on language id. * Update `Editor::refresh_language_server` to try language detection only if language is not already set. * Remove language detection from Editor::refresh_language_server * Move document language detection to where the scratch buffer is saved. * Rename Document::set_language3 to Document::set_language_by_language_id. * Remove unnecessary clone in completers::language