aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
Commit message (Collapse)AuthorAge
* enable smart case regex search by default (#761)kraem2021-09-20
|
* log errors produced when trying to initialize the LSP (#746)Kirawi2021-09-15
|
* Regex prompts should have a history with a specifiable registerBlaž Hrastnik2021-09-08
|
* lsp: Don't send notifications until initialize completesBlaž Hrastnik2021-09-06
| | | | Then send open events for all documents with the LSP attached.
* Simplify documents & documents_mut()Blaž Hrastnik2021-09-06
|
* lsp: Refactor code that could use document_by_path_mutBlaž Hrastnik2021-09-06
|
* Simplify textDocument/didClose, we don't need to look up LSP againBlaž Hrastnik2021-09-06
|
* Document macros (#693)oberblastmeister2021-09-05
| | | | | | | | | | | | | | | * add docs * clean up * remove * more * Update helix-view/src/macros.rs Co-authored-by: Ivan Tham <pickfire@riseup.net> Co-authored-by: Ivan Tham <pickfire@riseup.net>
* Shell commands (#547)Omnikar2021-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement shell interaction commands * Use slice instead of iterator for shell invocation * Default to `sh` instead of `$SHELL` for shell commands * Enforce trailing comma in `commands` macro * Use `|` register for shell commands * Move shell config to `editor` and use in command * Update shell command prompts * Remove clone of shell config * Change shell function names to match prompts * Log stderr contents upon external command error * Remove `unwrap` calls on potential common errors `shell` will no longer panic if: * The user-configured shell cannot be found * The shell command does not output UTF-8 * Remove redundant `pipe` parameter * Rename `ShellBehavior::None` to `Ignore` * Display error when shell command is used and `shell = []` * Document shell commands in `keymap.md`
* Move path util functions from helix-term to helix-core (#650)Kirawi2021-08-25
|
* Extract view.inner_area(), simplify render_focused_view_elementsBlaž Hrastnik2021-08-19
|
* Refactor view.first_line/first_col into view.offset (Position)Blaž Hrastnik2021-08-19
|
* feat: relative numbers (#485)Grzegorz Baranski2021-08-16
| | | | | | | | | | | | | | | | | | | * feat(helix-view): configuring line-number * feat(helix-term): relative line numbers * feat(helix-term): passing editor::Config to render * fix(helix-view): remove LineNumber::None * feat(helix-term): rendering line-number according to configuration * fix(term): put calculating current line above line iteration * fix: add abs_diff function * deps: cargo update * fix: pass config argument
* Show file preview in split pane in fuzzy finder (#534)Gokul Soumya2021-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add preview pane for fuzzy finder * Fix picker preview lag by caching * Add picker preview for document symbols * Cache picker preview per document instead of view * Use line instead of range for preview doc * Add picker preview for buffer picker * Fix render bug and refactor picker * Refactor picker preview rendering * Split picker and preview and compose The current selected item is cloned on every event, which is undesirable * Refactor out clones in previewed picker * Retrieve doc from editor if possible in filepicker * Disable syntax highlight for picker preview Files already loaded in memory have syntax highlighting enabled * Ignore directory symlinks in file picker * Cleanup unnecessary pubs and derives * Remove unnecessary highlight from file picker * Reorganize buffer rendering * Use normal picker for code actions * Remove unnecessary generics and trait impls * Remove prepare_for_render and make render mutable * Skip picker preview if screen small, less padding
* Support primary clipboard (#548)Dmitry Sharshakov2021-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clipboard-none: add in-memory fallback buffer Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * view: add Wayland primary clipboard Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * Format Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: copy to primary selection after mouse move stops Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: don't update primary selection if it is a single character Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: discard result of setting primary selection Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: add commands for interaction with primary clipboard Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * editor: implement primary selection copy/paste using commands Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * clipboard: support xsel for primary selection Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * clipboard: support xclip for primary selection Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: multiple cursor support for middle click paste Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * rename primary selection to primary clipboard in scope of PR Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: make middle click paste optional Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * Format Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * Update helix-term/src/ui/editor.rs * fix formatting Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * config: correct defaults if terminal prop is not set Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * refactor: merge clipboard and primary selection implementations Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * Tidy up code Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * view: remove names for different clipboard/selection providers Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * Update helix-view/src/clipboard.rs Co-authored-by: Gokul Soumya <gokulps15@gmail.com> * helix-view: tidy macros Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: refactor paste-replace commands Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: use new config for middle-click-paste Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * clipboard: remove memory fallback for command and windows providers Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * clipboard-win: fix build Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * clipboard: return empty string when primary clipboard is missing Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * clipboard: fix errors in Windows build Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
* helix-term: handle scrolling when mouse is enabled (#554)Dmitry Sharshakov2021-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * helix-term: handle scrolling when mouse is enabled Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: configure scrolling speed Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: use new config for scrolling Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * config: defaults for edtior config Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * config: add scroll-lines property Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: scroll hovered view Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: support inverted scrolling Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: remove duplicating code Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: do not focus view while scrolled Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * helix-term: refactor mouse events and scrolling Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> * simplify Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* config: Rename [terminal] to [editor] and pass it into EditorBlaž Hrastnik2021-08-08
|
* Merge branch 'master' into great_line_ending_and_cursor_range_cleanupNathan Vegdahl2021-07-26
|\
| * Allow multi key remappings in config file (#454)Gokul Soumya2021-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use tree like structure to store keymaps * Allow multi key keymaps in config file * Allow multi key keymaps in insert mode * Make keymap state self contained * Add keymap! macro for ergonomic declaration * Add descriptions for editor commands * Allow keymap! to take multiple keys * Restore infobox display * Fix keymap merging and add infobox titles * Fix and add tests for keymaps * Clean up comments and apply suggestions * Allow trailing commas in keymap! * Remove mode suffixes from keymaps * Preserve order of keys when showing infobox * Make command descriptions smaller * Strip infobox title prefix from items * Strip infobox title prefix from items
* | Collect some common patterns into methods on `Range`.Nathan Vegdahl2021-07-26
| |
* | Fixed primary cursor position calculation to use 1-width semantics.Nathan Vegdahl2021-07-19
|/ | | | | This had a bunch of knock-on effects that were buggy, such as bracket match highlighting.
* Changed startup behaviour to only open a single view when multiple files are ↵Cor2021-07-17
| | | | | | specified on the commandline. Changed the behaviour; the first argument on the commandline is the file on display
* Further simplify error handling in :commandsBlaž Hrastnik2021-07-11
|
* Make command implementation return a Result<()>Lionel Flandrin2021-07-11
| | | | The error message is displayed with cx.editor.set_error.
* Reduce calculation and improve pattern in infoboxIvan Tham2021-07-04
| | | | | | - switch to use static OnceCell to calculate Info once - pass Vec<(&[KeyEvent], &str)> rather than Vec<(Vec<KeyEvent>, &str)> - expr -> tt to allow using | as separator, make it more like match
* Add infoboxIvan Tham2021-07-04
|
* Make formatting happen asynchronously.Joe Neeman2021-06-30
|
* reverse the dependency between helix-tui and helix-view (#366)Keith Simmons2021-06-25
| | | | | | | | | * reverse the dependency between helix-tui and helix-view by moving a fiew types to view * fix tests * clippy and format fixes Co-authored-by: Keith Simmons <keithsim@microsoft.com>
* Handle non-UTF8 filesShafkath Shuhan2021-06-23
|
* Merge branch 'master' of github.com:helix-editor/helix into ↵Nathan Vegdahl2021-06-20
|\ | | | | | | | | | | | | line_ending_detection Rebasing was making me manually fix conflicts on every commit, so merging instead.
| * Add system clipboard yank and paste commandsBenoît CORTIER2021-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds six new commands to interact with system clipboard: - clipboard-yank - clipboard-yank-join - clipboard-paste-after - clipboard-paste-before - clipboard-paste-replace - show-clipboard-provider System clipboard provider is detected by checking a few environment variables and executables. Currently only built-in detection is supported. `clipboard-yank` will only yank the "main" selection, which is currently the first one. This will need to be revisited later. Closes https://github.com/helix-editor/helix/issues/76
| * Only reconfiure highlights when setting themewojciechkepka2021-06-19
| |
| * Add ability to change theme on editorwojciechkepka2021-06-19
| |
* | Work on moving code over to LineEnding instead of assuming '\n'.Nathan Vegdahl2021-06-20
|/ | | | Also some general cleanup and some minor fixes along the way.
* Add `close_language_servers` method on `Editor`wojciechkepka2021-06-19
|
* Replace `Editor::current` by a macroBenoît CORTIER2021-06-18
| | | | | | | | | This is necessary to workaround ownership issues across function calls. The issue notably arised when implementing the registers into `Editor` and I was getting annoyed again when implementing copy/pasting into system clipboard. The problem is addressed by using macro calls instead of function calls. There is no notable side effect.
* Add cursor kind to separate hidden cursor from posIvan Tham2021-06-15
| | | | | Now IME cursor position should be correct since we can still set cursor position without drawing the cursor.
* Remove RwLock for registersBenoît CORTIER2021-06-15
| | | | | | | | Registers are stored inside `Editor` and accessed without `RwLock`. To work around ownership, I added a sister method to `Editor::current`: `Editor::current_with_context`. I tried to modify `Editor::current` directly but it's used at a lot of places so I reverted into this for now at least.
* add alternate file (#223)Robin2021-06-12
| | | | | | | | | | | | | * add alternate file inspired by vim ctrl-6/kak ga commands. the alternate file is kept per view * apply feedback from #223 * rename to last_accessed * add ga doc * add fail message for ga
* lsp: Display LSP progress messages (#216)Wojciech Kępka2021-06-11
|
* Derive debug without featureIvan Tham2021-06-10
| | | | Note that this also removed those `finish_non_exhaustive()`.
* Implement Debug for data structure as a featurenotoria2021-06-10
|
* Support go to line 1Zheming Li2021-06-08
|
* Don't panic on LSP not startingEgor Karavaev2021-06-08
|
* Implement register selectionBenoît CORTIER2021-06-07
| | | | | | User can select register to yank into with the " command. A new state is added to `Editor` and `commands::Context` structs. This state is managed by leveraging a new struct `RegisterSelection`.
* Create document if it doesn't exist on saveWojciech Kępka2021-06-06
|
* Try to detect language when document file path is setBlaž Hrastnik2021-06-04
| | | | Fixes #91
* Fix split sizes getting out of sync with the terminal size, refs #69Blaž Hrastnik2021-06-03
|
* Address clippy lint.Blaž Hrastnik2021-05-17
|
* If switching to a previously open buffer in the same view, keep it's old offsetBlaž Hrastnik2021-05-17
|