Commit Graph

146 Commits (6db666fce1fb4627c06d147554b8e1eb9970619e)

Author SHA1 Message Date
nibon7 43997f1936
Use `^` and `$` to match the beginning and end of a line when searching (#1790)
Fixes #1737

Signed-off-by: nibon7 <nibon7@163.com>
2 years ago
Michael Davis 4fc991fdec migrate grammar fetching/building code into helix-loader crate
This is a rather large refactor that moves most of the code for
loading, fetching, and building grammars into a new helix-loader
module. This works well with the [[grammars]] syntax for
languages.toml defined earlier: we only have to depend on the types
for GrammarConfiguration in helix-loader and can leave all the
[[language]] entries for helix-core.
2 years ago
Blaž Hrastnik 78fba8683b
Picker performance improvements 2 years ago
Philipp Mildenberger 49c5bc5934
Add jumplist support for the search (closes #1625) (#1718) 2 years ago
Daniel S Poulin bdbf423876
Minor cleanup of file picker file gathering logic (#1683)
* Refactor file picker filetype filter logic to remove panic, make clearer

An unwrap was unneccesarily present due to a prior contribution of mine
which was before I had any understanding of error handling in Rust. I've
also swapped a match for an if let, as was originally suggested in the
original pull request adding filetype filtering, but was merged before I
could address.

* Add some comments to the file picker code for clarity

* Switch to expect instead of ignoring type def error
2 years ago
Daniel S Poulin 700058f433
Always ignore the .git directory in file picker (#1604)
Some users (including myself) want to turn off filtering of files
prefixed with `.`, as they are often useful to edit. For example, `.env`
files, configuration for linters `.eslint.json` and the like.
2 years ago
Blaž Hrastnik c06155ace4 Extract a helper function for lsp::Location 2 years ago
Blaž Hrastnik 24f90ba8d8 Manually recalculate initial completion where it matters 2 years ago
Blaž Hrastnik af21e2a5b4 Pass through Editor instead of Context 2 years ago
Cole Helbling 6118486eb2 helix-term: implement buffer completer
In order to implement this completer, the completion function needs to
be able to access the compositor's context (to allow it to get the
list of buffers currently open in the context's editor).
2 years ago
Ludwig Stecher 4429993842
Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard shortcuts to file picker (#1612)
* Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard shortcuts to file picker

* Refactor file picker paging logic

* change key mapping

* Add overlay component

* Use closure instead of margin to calculate size

* Don't wrap file picker in `Overlay` automatically
2 years ago
Kirawi 23907a063c
use PathBuf::to_string_lossy() instead of to_str() (#1655) 2 years ago
Blaž Hrastnik bd549d8a20 Merge remote-tracking branch 'origin/master' into debug 2 years ago
Matouš Dzivjak fdb9a1677b
feat(editor): add config for search wrap_around (#1516)
* feat(editor): add config for search wrap_around

Fixes: https://github.com/helix-editor/helix/issues/1489

* Move search settings into separate config

* Disable linter
2 years ago
Blaž Hrastnik 094a0aa3f9 Render code actions as a menu, allow adding padding to popup 2 years ago
Blaž Hrastnik 3e4f81547c fix: Use std::path::MAIN_SEPARATOR to determine completion
Refs #1439
3 years ago
Blaž Hrastnik bed9aced5f Revert "Convert Windows style path separator in completers to Unix style (#1389)"
This reverts commit 49444f9c05.
3 years ago
ath3 49444f9c05
Convert Windows style path separator in completers to Unix style (#1389) 3 years ago
Tamo a306a1052a
Update settings at runtime (#798)
* feat: Update settings at runtime

fix the clippy warning

* update the documentation

* use to_value instead of to_vec+from_value

* drop the equal

* remove an useless comment

* apply suggestion
3 years ago
Omnikar 98ce2a301d Load alt default theme if true color is not supported
* Move `runtime/themes/base16_default_terminal.toml` to
  `base16_theme.toml` alongside `theme.toml`
* Use `terminfo` crate to detect whether the terminal supports true
  color and, if the user has no theme configured and their terminal does
  not support true color, load the alt default theme instead of the
  normal default.

Remove `terminfo` dependency, use `COLORTERM` env instead

Prevent user from switching to an unsupported theme

Add `true-color-override` option

If the terminal is wrongly detected to not support true color,
`true-color-override = true` will override the detection.

Rename `true-color-override` to `true-color`
3 years ago
Blaž Hrastnik 9ed930b233 Merge remote-tracking branch 'origin/master' into debug 3 years ago
Blaž Hrastnik 0eadeab8c7 dap: Remove the prompt line parameter, use insert_str instead 3 years ago
Blaž Hrastnik d1854d8e6a Merge remote-tracking branch 'origin/master' into debug 3 years ago
Dan Nases Sha 6a4d9693ba
File picker config (#988)
* squashed WIP commits

* hide_gitignore working with config

* pass reference to new config parameter of file_picker()

* update config option name to match name on walk builder

* add comments to config and documentation of option to book

* add git_ignore option to WalkBuilder within prompt in commands.rs

* WIP: add FilePickerConfig struct

* WIP: cleanup

* WIP: add more options including max_depth

* WIP: changed defaults to match ignore crate defaults

* WIP: change WalkBuilder in global_search() to use config options

* WIP: removed follow_links, changed max_depth to follow config setting

* WIP: update book with file-picker inline table notation

* update documentation for file-picker config in book

* adjusted to [editor.file-picker] in book configuration.md

* adjust comments in editor.rs to be doc comments, cleanup

* adjust comments

* adjust book
3 years ago
Ivan Tham 97893cca64
Restore screen position when abort search (#1047) 3 years ago
Blaž Hrastnik 3b8d5102ac Make picker take the whole context, not just editor 3 years ago
Blaž Hrastnik f2b709a3c3 Merge branch 'master' into debug 3 years ago
CossonLeo 39584cbccd
Add c-s to pick word under doc cursor to prompt line & search completion (#831)
* Add prompt shourtcut to book
Add completions to search
Add c-s to pick word under doc cursor to prompt line

* limit 20 last items of search completion, update book

* Update book/src/keymap.md

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

* limit search completions 200

Co-authored-by: Ivan Tham <pickfire@riseup.net>
3 years ago
Daniel S Poulin 3b032e8e1f
First stab at ignoring compressed files from picker (#767) 3 years ago
Dmitry Sharshakov bf53aff27d Merge branch 'master' into debug 3 years ago
Leoi Hung Kin 9456d5c1a2
Initial implementation of global search (#651)
* initial implementation of global search

* use tokio::sync::mpsc::unbounded_channel instead of Arc, Mutex, Waker poll_fn

* use tokio_stream::wrappers::UnboundedReceiverStream to collect all search matches

* regex_prompt: unified callback; refactor

* global search doc
3 years ago
kraem 4a003782a5
enable smart case regex search by default (#761) 3 years ago
Blaž Hrastnik 72cf86e462 Regex prompts should have a history with a specifiable register 3 years ago
Dmitry Sharshakov 1befbd076c Add command for editing breakpoint condition 3 years ago
Blaž Hrastnik a3bd80a6fa ui: prompt: Avoid allocating a prompt name if it's a static string 3 years ago
Stuart Hinson 6192f2fa25
Show hidden files in filename completer (#648)
also removes unnecessary clone
3 years ago
Kirawi b99db7c687
Move path util functions from helix-term to helix-core (#650) 3 years ago
Blaž Hrastnik cbd39d67a4 minor: Refactor commands.rs a bit more 3 years ago
Gokul Soumya d84f8b5fde
Show file preview in split pane in fuzzy finder (#534)
* 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
3 years ago
Blaž Hrastnik a2ccfffda1 config: Rename [terminal] to [editor] and pass it into Editor 3 years ago
Blaž Hrastnik 63e54e30a7 Implement in-memory prompt history
Implementation is similar to kakoune: we store the entries into
a register.
3 years ago
Ivan Tham 8985c58fd3 Add infobox 3 years ago
Nathan Vegdahl efa3389b6a Fix unused variable, parameter, and `mut` warnings in helix-term. 3 years ago
Nathan Vegdahl 702a0491db Remove #[allow(unused)] from helix-term, and fix unused imports.
Lots of other warning still left.  Will address in subsequent commits.
3 years ago
Blaž Hrastnik d94410a678 Sort the files in descending order 3 years ago
Blaž Hrastnik cad14c6b46 Address nightly clippy warnings 3 years ago
Wojciech Kępka eb6fb63e74
Sort files in file picker by access, modification and creation date (#336)
* Sort files in file picker by access date

* Fallback file time to modified then created then UNIX_EPOCH

* Use `sort_by_key`

* Refactor
3 years ago
Keith Simmons 4418e17547
reverse the dependency between helix-tui and helix-view (#366)
* 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>
3 years ago
Joe Neeman fd1ae35051 Make the prompt callback take a Context. 3 years ago
Lionel Flandrin b56174d738 Implement change_current_directory command 3 years ago
Blaž Hrastnik 20f33ead67 minor: Remove old TODOs 3 years ago
wojciechkepka b2804b14b1 Add a `Spinner` 3 years ago
wojciechkepka a2db161d5a Add theme completer 3 years ago
Wojciech Kępka 41b07486ad
Fix expansion of `~` (#284)
* Fix expansion of `~`, dont use directory relative to cwd.

* Add `expand_tilde`

* Bring back `canonicalize_path`, use `expand_tilde` to `normalize`

* Make `:open ~` completion work

* Fix clippy

* Fold home dir into tilde in Document `realitve_path`
3 years ago
Benoît CORTIER 8664d70e73 Replace `Editor::current` by a macro
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.
3 years ago
Benoît CORTIER 6bdf609caa Remove RwLock for registers
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.
3 years ago
Kevin Sjöberg b20e4a108c Only enforce limit outside of .git 3 years ago
Kevin Sjöberg 08f50310bd Bump file picker limit 3 years ago
Blaž Hrastnik 51d1d43289 Double the UI picker file limit. 3 years ago
Blaž Hrastnik f0712479cb Define text color (mostly) in theme.toml. 3 years ago
Blaž Hrastnik ff84c8e394 Command mode: Per command completers. 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 811f952a41 Center search results. 3 years ago
Blaž Hrastnik cc058ad78f Simplify some code. 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 6c4093c946 Weave through view_id references so that views into one file have independent selects. 3 years ago
Blaž Hrastnik e833d65b77 Teach file picker how to find the project root (.git). 3 years ago
Blaž Hrastnik 742b3a709f Store intra-files jumps (goto) on the jumplist. 3 years ago
Blaž Hrastnik 5c2d2fda21 Wire up opening in splits via pickers. 3 years ago
Blaž Hrastnik a24c3fff54 Filter the completion menu based on text entered. 3 years ago
Blaž Hrastnik 915fd9ebaf Restore buffer_picker. 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 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 698e4ddea4 clippy: Factor out a Completion type. 3 years ago
Blaž Hrastnik a32806b490 Improve completion: src/<tab> will now correctly complete to src/main.rs 3 years ago
Blaž Hrastnik c331721565 Finish hiding doc.state / State as an implementation detail. 3 years ago
Blaž Hrastnik 51c15da3c3 Hold a reference to executor on the Editor type. 3 years ago
Blaž Hrastnik 1d42b95915 ui: wip: Markdown doc renderer. 3 years ago
Blaž Hrastnik 4c6611f96b commands: Stop select_regex from breaking when no matches. 3 years ago
Blaž Hrastnik bd0f6c1dfc clippy lint 3 years ago
Blaž Hrastnik 0b85c16be9 ui: Share popup code with menu.
Menu is now just wrapped in a popup.
3 years ago
Blaž Hrastnik 857bce0e30 ui: Rework command mode, implement file path completion. 3 years ago
Blaž Hrastnik 7162632eb7 lsp: Hover documentation draft. 3 years ago
Blaž Hrastnik 83d48f10ea search: Barebones implementation. 3 years ago
Blaž Hrastnik d4b85ce18d popup: wip work on completion popups 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 2bea5db7bd commands: Implement select_on_matches. 3 years ago
Blaž Hrastnik 05c7fb98df Refactoring: move language_servers into Editor, proper load for doc. 3 years ago
Blaž Hrastnik 47e282804d buffer picker: Mark current view with (*) 4 years ago
Blaž Hrastnik 3d3295bb75 ui: buffer picker on ctrl-b 4 years ago
Blaž Hrastnik 25aa45e76c picker: Factor out file picker, we want to reuse code for other pickers. 4 years ago
Blaž Hrastnik 7c75ec04e8 File picker mockup, reuses the line editor work done on Prompt. 4 years ago
Blaž Hrastnik 8f0b28aeb8 Make the select prompt interactive. 4 years ago
Blaž Hrastnik 7dc24a25ba Move ui modules under a ui:: namespace. 4 years ago