Commit Graph

304 Commits (f0eb6ed96a6e61ee6abe3aa14071cfc003d0b37f)

Author SHA1 Message Date
Wojciech Kępka 098806ce2a
lsp: Display LSP progress messages (#216) 3 years ago
notoria 9887b1275a Implement missing Debug and update Cargo.lock 3 years ago
Ivan Tham 7cc13fefe9 Derive debug without feature
Note that this also removed those `finish_non_exhaustive()`.
3 years ago
notoria 1a3a924634 Implement Debug for data structure as a feature 3 years ago
Ivan Tham 6b3c9d8ed3 Fix jump behavior, goto_implementation now jump
Better jump behavior since we override the first jump if it's on the
first document. At the same time, ctrl-i is now working with gd jumps.
3 years ago
Kevin Sjöberg 7ef0e2cab6 Don't panic on empty document 3 years ago
Zheming Li ae51065213 Support go to line 1 3 years ago
Kirawi b873fb9897
Fix Unicode (#135)
* init

* wip

* wip

* fix unicode break

* fix unicode break

* Update helix-core/src/transaction.rs

Co-authored-by: Benoît Cortier <benoit.cortier@fried-world.eu>

* clippy

* fix

* add changes

* added test

* wip

* wip

* wip

* wip

* fix

* fix view

* fix #88

Co-authored-by: Benoît Cortier <benoit.cortier@fried-world.eu>
3 years ago
Ivan Tham 82fdfdc38e Add missing newline to end of file on load
Fix #152
3 years ago
Egor Karavaev 960bc9f134 Don't panic on LSP not starting 3 years ago
Benoît CORTIER 68affa3c59 Implement register selection
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`.
3 years ago
Wojciech Kępka 16b1cfa3be Add diagnostics keybindings 3 years ago
Ingrid 54f3548d54
theme: Enable style modifiers in theme.toml, add Ingrid's theme (#113)
* theme: Enable style modifiers in theme.toml

* docs: theme documentation

* fixup: parse modifiers with filter_map

* theme: tests for parse_style

* theme: Log invalid cases in theme.toml parse

* docs: theme documentation fixup

* docs: Blaz's theming comments

* docs: Theme doc fixes from pickfire

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

* theme: More context in logs, TODO for alerting users

* contrib: Ingrid's theme

* docs: Theme subsection fixes

Co-authored-by: Ivan Tham <pickfire@riseup.net>
3 years ago
Wojciech Kępka bcb1afeb4c Add a comment to `canonicalize_path` 3 years ago
Wojciech Kępka de946d2357 Add a TODO 3 years ago
Wojciech Kępka 14f511da93 Create document if it doesn't exist on save 3 years ago
Kirawi c17dcb8633
Fixing Multiple Panics (#121)
* init

* wip

* wip
3 years ago
Blaž Hrastnik 06d8d3f55f Try to detect language when document file path is set
Fixes #91
3 years ago
Ivan Tham e6132f0acd Fix undo redo
I missed the fast return.

Fix #89
3 years ago
Jakub Bartodziej 3c5dfb0633 Improve on the fix for deleting from the end of the buffer. 3 years ago
Jakub Bartodziej 6cbc0aea92 Disable deleting from an empty buffer which can cause a crash. 3 years ago
Blaž Hrastnik c0332bd935 Fix split sizes getting out of sync with the terminal size, refs #69 3 years ago
Rowan Herbert 1b67fae9f4 Fix panic when buffer larger than terminal width 3 years ago
Ivan Tham f5f46b1fed Separate document history into Cell
As history is used separately from the rest of the edits, separating it
can avoid needless borrowing and cloning. But one need to be aware later.
3 years ago
Blaž Hrastnik ce25aa951e Allow setting a filepath on :write 3 years ago
Blaž Hrastnik 2c48d65b15 Format document on save 3 years ago
Blaž Hrastnik 2100f5a2c0 Address clippy lint. 3 years ago
Blaž Hrastnik 8f6f329057 If switching to a previously open buffer in the same view, keep it's old offset 3 years ago
Blaž Hrastnik 4a9d1163e0 Hacky way to specify indent scopes per language via toml configs.
Can't do it via a scm query nicely because it returns an iterator over
all the matches, whereas we want to traverse the tree ourselves.

Can't extract the pattern data from a parsed query either.

Oh well, toml files for now.
3 years ago
Blaž Hrastnik c0a8b81487 Only send the document close event if we're closing the underlying buffer 3 years ago
Blaž Hrastnik c20813690f View::new is infallible, so is editor.switch/new_file. 3 years ago
Blaž Hrastnik f2c79e245b Allow switching views back to scratch buffers. 3 years ago
Blaž Hrastnik 418ee17b86 Canonicalize the path on open to avoid duplicates. 3 years ago
Blaž Hrastnik 7c915dc065 Add the :new command, don't crash if saving without filename. 3 years ago
Blaž Hrastnik fd4fd12fa3 clippy lint 3 years ago
Blaž Hrastnik d00414f81a Start moving more LSP calls into callbacks/futures without capturing self 3 years ago
Blaž Hrastnik 355ad3cb82 Tokio migration. 3 years ago
Blaž Hrastnik b0bdcab970 doc: Note about diagnostic mapping. 3 years ago
Blaž Hrastnik 28c167d71d doc: Be smarter about calculating modified status.
This way edit -> undo will properly show up as unmodified.
3 years ago
Blaž Hrastnik b5b650cfe7 Fix the last line calculation inside ensure_cursor_in_view 3 years ago
Blaž Hrastnik 3e5f24a9d5 lsp: support both utf-8 and utf-16 offsets.
Still need to implement the clangd encoding negotiation, but it's
a start. Should also manually override to utf8 for pyls.
3 years ago
Blaž Hrastnik 180521fefe Adjust scroll() to match kakoune: only scroll the view if cursor in bounds. 3 years ago
Blaž Hrastnik 978f5114d8 Horizontal scrolling! It only took a year to get around to it. 3 years ago
Blaž Hrastnik 52da68e49a Render a separator between vertical splits. 3 years ago
Blaž Hrastnik 9f318a8529 Fix an issue with closing nested splits.
The parent id was never assigned to the split, so removing the container
when it became empty failed.
3 years ago
Blaž Hrastnik 8b33ba2284 Correct the naming issue with vsplit and hsplit being swapped. 3 years ago
Blaž Hrastnik bc4e54c0c4 Load config files from ~/.config/helix, fallback to defaults. 3 years ago
Blaž Hrastnik 91462af546 Allow starting hx without a file. A new blank file will be created. 3 years ago
Blaž Hrastnik cf7b19d711 Always update selection: Empty transactions can still change selections. 3 years ago
Blaž Hrastnik 0dbd5b61ef Simplify code by providin cx.current() = (view, doc). 3 years ago
Blaž Hrastnik ceea5eacd8 clippy lint 3 years ago
Blaž Hrastnik 15c9a33ebc Drop doc.state. Use doc.text + doc.selections. 3 years ago
Blaž Hrastnik 6c4093c946 Weave through view_id references so that views into one file have independent selects. 3 years ago
Blaž Hrastnik 9eaef6e333 Fully drop State references. 3 years ago
Blaž Hrastnik 1b5316ea74 Track document modified state. 3 years ago
Blaž Hrastnik 742b3a709f Store intra-files jumps (goto) on the jumplist. 3 years ago
Blaž Hrastnik c1f2a14453 view: document.rs cleanup 3 years ago
Blaž Hrastnik aefafc25cd Replace Mode::Goto with just using on_next_key. 3 years ago
Blaž Hrastnik cf0e191a6a Clippy lint 3 years ago
Blaž Hrastnik a65395d94b Load theme from toml file. 3 years ago
Blaž Hrastnik e3c4edae32 Add the machinery to load syntax config from TOML.
It's embedded into the binary at build time for now, but it's progress.
3 years ago
Blaž Hrastnik 8657c57cf2 Trivial jumplist implementation. 3 years ago
Blaž Hrastnik 4b176caded Reset first_line when changing files. 3 years ago
Blaž Hrastnik 8a0ab447ec editor.open can now either replace the current view or open in a split. 3 years ago
Blaž Hrastnik b24cdd1295 Derive a separate ViewId type. 3 years ago
Blaž Hrastnik 8328fe926d Drop refcell use, make view simply ref doc.id. 3 years ago
Blaž Hrastnik bf95ee27aa Store Document on the Editor type, make View reference it. 3 years ago
Blaž Hrastnik 5e6716c89c Add tab_width and indent_unit config. 3 years ago
Blaž Hrastnik cbcacb1063 Merge some imports. 3 years ago
Blaž Hrastnik c4792efead clippy lints 3 years ago
Blaž Hrastnik c331721565 Finish hiding doc.state / State as an implementation detail. 3 years ago
Blaž Hrastnik 8ba1e15d29 Expose doc.syntax() via accessor. 3 years ago
Blaž Hrastnik 2b64f49f2c Document::new should just take a rope. 3 years ago
Blaž Hrastnik e261f3c50d Expose doc.language_server as an accessor. 3 years ago
Blaž Hrastnik 59e6024186 Remove State from a few more signatures. 3 years ago
Blaž Hrastnik 8eaf9a432d Make Transaction::change only rely on the rope. 3 years ago
Blaž Hrastnik 51c15da3c3 Hold a reference to executor on the Editor type. 3 years ago
Blaž Hrastnik e3ec5e31ec Fix goto code before merging. 3 years ago
Jan Hrastnik eadad13efa preparing for gd merge 3 years ago
Jan Hrastnik 4e461bea2f editor.open now checks if view already exists 3 years ago
Jan Hrastnik 3869d7713e added goto functions in helix-term 3 years ago
Jan Hrastnik b738ae1bc7 more goto lsp functions 3 years ago
Blaž Hrastnik d8599f3a14 ui: Syntax highlight code inside markdown popups. 3 years ago
Blaž Hrastnik 54a7e893b7 lsp: Wire up didClose notification on editor.close. 3 years ago
Blaž Hrastnik eca2a73ad0 lsp: Pass through language_id on didOpenTextDocument. 3 years ago
Blaž Hrastnik 143cfe13e0 minor: TODO comment cleanup 3 years ago
Blaž Hrastnik dd91090a1a Implement keep_selections (filter selections on regex). 3 years ago
Blaž Hrastnik bb87b08fc9 Configure language servers via LanguageConfiguration. 3 years ago
Blaž Hrastnik 1cf887dea9 Cleanup: use doc.selection() instead of doc.state.selection(). 3 years ago
Blaž Hrastnik 6cbfb050e2 lsp: Emit didSave notifications. 3 years ago
Blaž Hrastnik 9dcfe25e4a Use diagnostic.severity to distinguish between error colors. 3 years ago
Blaž Hrastnik a5c4314940 commands: Improve scroll functions.
Followed kakoune's implementation, it's no longer janky and can scroll
all the way in either direction.
3 years ago
Blaž Hrastnik 8f4ff4c646 editor: We still want to be able to calculate cursor pos. 3 years ago
Blaž Hrastnik ec4dd0a176 Add a selection mode again. 3 years ago
Blaž Hrastnik 00808afe3c ui: Make editor more resilient about being shrunk too small. 3 years ago
Blaž Hrastnik 6336c1da20 view: Reposition cursors on tree resize. 3 years ago
Blaž Hrastnik 8289bd1cb0 minor, fix clippy lint 3 years ago
Blaž Hrastnik 01907b3497 commands: Implement count for a few more commands. 3 years ago
Blaž Hrastnik 87a6d4e736 minor: Simplify some code. 3 years ago
Blaž Hrastnik 8b9b02f08b minor 3 years ago
Blaž Hrastnik 3b6c9648f3 fix clippy lint 3 years ago
Blaž Hrastnik 9132c6a591 Make some Document fields read-only. 3 years ago
Blaž Hrastnik 7da6bd6a71 commands: Simplify some code, only calling cx.doc() once. 3 years ago
Blaž Hrastnik 7877647cf0 Allow closing individual views. 3 years ago
Blaž Hrastnik 0827c45d94 view: Disable tree.fullscreen for now to appease clippy. 3 years ago
Blaž Hrastnik c9dd1c930e treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref 3 years ago
Blaž Hrastnik d5f9622e2e lsp: edit events change ranges need to affect each other. 3 years ago
Blaž Hrastnik 1ffd1e7633 Send updates to the lsp on undo/redo. 3 years ago
Blaž Hrastnik b7da7f83c3 lsp: Test changeset_to_changes. 3 years ago
Blaž Hrastnik de5170dcda Parse input counts: 10w, etc. 3 years ago
Blaž Hrastnik 5e73f83efa Implement vertical split calculations. 3 years ago
Blaž Hrastnik d4b85ce18d popup: wip work on completion popups 3 years ago
Blaž Hrastnik a924ad2885 simplify. 3 years ago
Blaž Hrastnik c70080dd68 Work around rendering errors for positions offscreen. 3 years ago
Blaž Hrastnik 8f0ddf9632 Address clippy warnings. 3 years ago
Blaž Hrastnik 9c33b5340a A dumb "next view" implementation that works. 3 years ago
Blaž Hrastnik 5554910e08 Forgot to add the tree.rs definition... 3 years ago
Blaž Hrastnik 446a7e5743 Don't render selections/cursors on views not in focus. 3 years ago
Blaž Hrastnik 448c1abba0 View tree implementation: render multiple split views.
Cursors are still a bit buggy and we should render in focus statusbar
differently than in the other pane.
3 years ago
Blaž Hrastnik 05c7fb98df Refactoring: move language_servers into Editor, proper load for doc. 3 years ago
Blaž Hrastnik 777a80917d Address clippy lints. 4 years ago
Blaž Hrastnik 3cbab20908 lsp: Fix pos_to_lsp_pos calculation. 4 years ago
Blaž Hrastnik 2ab069bb3f lsp: Work on syncing the state with the language server. 4 years ago
Blaž Hrastnik ea502c8665 fix change -> change -> undo -> change -> undo -> undo. 4 years ago
Blaž Hrastnik d181027225 fix: undo/redo selection handling. 4 years ago
Blaž Hrastnik 0b63e838e0 Port over Doc::relative_path. 4 years ago
Blaž Hrastnik 5103dc9617 move commands and keymap back to terminal.
Command needs to be able to deal with UI. We'll separate it again later
on.
4 years ago
Blaž Hrastnik 39bf1ca825 Update deps. 4 years ago
Blaž Hrastnik a7869c728c wip 4 years ago
Blaž Hrastnik 3f707c19f4 Save command 4 years ago
Blaž Hrastnik 8f0bcfe286 Introduce a command context that carries the executor and other fields. 4 years ago
Blaž Hrastnik ae8a9e5bac lsp: Make base request methods take &self instead of &mut self. 4 years ago
Blaž Hrastnik cc6bdf8f66 Text change generation, RPC call handling. 4 years ago
Blaž Hrastnik eff6fac9ec clippy lint 4 years ago
Blaž Hrastnik f5981f72c2 Introduce Selection::point. 4 years ago
Blaž Hrastnik 55fa86248c Introduce doc.selection()/set_selection() 4 years ago
Blaž Hrastnik e4070d4de0 Bump document version on undo/redo. 4 years ago
Blaž Hrastnik efc5aa2016 Simplify old_state handling. 4 years ago
Blaž Hrastnik c0e17dd324 Fix undo/redo not updating the syntax tree. 4 years ago
Blaž Hrastnik b39849dde1 Refactor: Document type as a wrapper around barebones State. 4 years ago
Blaž Hrastnik ef5e5f9296 state.version tracking 4 years ago
Blaž Hrastnik 49254d7180 Total mess but it works: diagnostic marking. 4 years ago
Blaž Hrastnik f9bfba4d96 Reroute LSP notification events into the main app event loop. 4 years ago
Blaž Hrastnik 64b5b23315 Move theme from view to editor, support multiple views in editor. 4 years ago
Blaž Hrastnik b2b3083a62 Support multiple open views. 4 years ago
Jan Hrastnik 1a3c647adf added col_height calculation 4 years ago
Jan Hrastnik 2b44031929 various fixes 4 years ago
Jan Hrastnik c9e9fcf7c5 added base col width 4 years ago
Jan Hrastnik 956173bcea completion is now added to prompt.line 4 years ago
Jan Hrastnik a123cf37a0 several fixes 4 years ago