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
2021-11-20 23:23:36 +09:00
Skyler Hawthorne
05c6cb1d0b
Solarized theme: fix popup colors, adjust menu ( #1124 )
...
* fix popup colors, adjust menu
* fix hardcoded horizontal rule color
2021-11-20 23:17:38 +09:00
Martin Junghanns
a3a3b0b517
Jump to end char of surrounding pair from any cursor pos ( #1121 )
...
* Jump to end char of surrounding pair from any cursor pos
* Separate bracket matching into exact and fuzzy search
* Add constants for bracket chars
* Abort early if char under cursor is not a bracket
* Simplify bracket char validation
* Refactor node search and unify find methods
* Remove bracket constants
2021-11-20 23:17:25 +09:00
Blaž Hrastnik
e9dc658de4
Remove unused imports
2021-11-18 18:41:44 +09:00
Blaž Hrastnik
9dcccb45bb
ui: Stop hardcoding markdown doc colors
2021-11-18 18:40:27 +09:00
Blaž Hrastnik
8db6fffe90
ui: Increase diagnostics sideline width to 100 max and wrap if needed
2021-11-16 15:02:48 +09:00
Bob
46d9ae2b62
Readline style insert mode ( #1039 )
...
* readline style insert mode
* update keymap.md
* don't save change history in insert mode
* Revert "don't save change history in insert mode"
This reverts commit cb47f946d7fb62ceda68e7d1692a3914d0be7762.
* don't affect register and history in insert mode
* add insert_register
* don't call exit_select_mode in insert mode
* avoid set_selection
* avoid duplicated current!
2021-11-16 00:31:20 +09:00
Ebbe Steenhoudt
edc976b6bb
Added workspace_symbol_picker ( #1041 )
...
* Added workspace_symbol_picker
* Moved truncation of the symbol pickers to the end.
* Fixed typo
2021-11-15 00:12:56 +09:00
ath3
35c974c9c4
Implement "Goto last modification" command ( #1067 )
2021-11-15 00:11:53 +09:00
Cole Helbling
b74912ea78
helix-term/editor: display scratch buffer name in status bar
2021-11-14 12:33:17 +05:30
Blaž Hrastnik
d3def16584
fix: shift-tab mappings broken after efc2b4c7
2021-11-12 16:21:03 +09:00
Omnikar
d131a9dd0e
Allow keys to be mapped to sequences of commands ( #589 )
...
* Allow keys to be mapped to sequences of commands
* Handle `Sequence` at the start of `Keymap::get`
* Use `"[Multiple commands]"` as command sequence doc
* Add command sequence example to `remapping.md`
2021-11-11 13:44:50 +09:00
ath3
c7cb7527be
Fix moving with arrow keys in prompt ( #1070 )
2021-11-11 11:08:19 +09:00
Gokul Soumya
efc2b4c77b
Refactor keyevent handling using key, ctrl macros ( #1058 )
...
Adds ctrl! and alt! macros (which existed before the big keymap
refactor) and uses them in event handling of Components. Note
that this converts crossterm's KeyEvent to our own KeyEvent on
each invocation of handle_event in Components.
2021-11-11 00:58:46 +09:00
Ivan Tham
97893cca64
Restore screen position when abort search ( #1047 )
2021-11-10 10:46:55 +09:00
Bob
7c9f620236
add <C-h>, <C-u>, <C-d>, Delete in prompt mode ( #1034 )
2021-11-09 14:43:50 +09:00
Blaž Hrastnik
8b85903116
wip
2021-11-08 10:03:08 +09:00
Omnikar
a252ecd8c8
Add WORD textobject ( #991 )
...
* Add WORD textobject
* Document WORD textobject
2021-11-08 09:54:39 +09:00
Blaž Hrastnik
5938ab1bf1
dap: Fully extract template parameter prompts
2021-11-07 18:13:37 +09:00
Blaž Hrastnik
3b8d5102ac
Make picker take the whole context, not just editor
2021-11-07 18:03:04 +09:00
Blaž Hrastnik
64bb1f7563
dap: Extract out variable rendering
...
Will improve on the UI later
2021-11-07 17:55:01 +09:00
Blaž Hrastnik
e2a23ac0b5
If there is no live debugger, treat breakpoints as unverified
2021-11-07 00:48:34 +09:00
Blaž Hrastnik
2e1aa5f15b
Fix compilation
2021-11-07 00:32:28 +09:00
Blaž Hrastnik
14a3502cf1
dap: Move template selection into a picker
...
It's time to move all these components out of ui/editor.rs
2021-11-07 00:28:57 +09:00
Blaž Hrastnik
f2b709a3c3
Merge branch 'master' into debug
2021-11-07 00:28:19 +09:00
Omnikar
cfc8285867
Allow infoboxes to be disabled ( #972 )
...
* Allow infoboxes to be disabled
* Document `infoboxes` default value
* Rename `infoboxes` to `auto_info`
* Document `auto-info`
* Fix incomplete rename
2021-11-05 11:25:08 +09:00
Blaž Hrastnik
e2560f427e
Replace documents SlotMap with BTreeMap
2021-11-04 13:43:45 +09:00
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>
2021-11-04 12:26:01 +09:00
diegodox
70d21a903f
Prevent preview binary or large file ( #939 )
...
* Prevent preview binary or large file (#847 )
* fix wrong method name
* fix add use trait
* update lock file
* rename MAX_PREVIEW_SIZE from MAX_BYTE_PREVIEW
* read small bytes to determine cotent type
* [WIP] add preview struct to represent calcurated preveiw
* Refactor content type detection
- Remove unwraps
- Reuse a single read buffer to avoid 1kb reallocations between previews
* Refactor preview rendering so we don't construct docs when not necessary
* Replace unwarap whit Preview::NotFound
* Use index access to hide unwrap
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* fix Get and unwarp equivalent to referce of Index acess
* better preview implementation
* Rename Preview enum and vairant
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
* fixup! Rename Preview enum and vairant
* simplify long match
* Center text, add docs, fix formatting, refactor
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
2021-11-04 12:24:52 +09:00
Omnikar
5b5d1b9dff
Truncate the starts of file paths instead of the ends in picker ( #951 )
...
* Truncate the starts of file paths in picker
* Simplify the truncate implementation
* Break loop at appropriate point
* Fix alignment and ellipsis presence
* Remove extraneous usage of `x_offset`
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2021-11-04 12:24:05 +09:00
Ivan Tham
3eb829e233
Ensure coords in screen depends on char width ( #885 )
...
The issue affected files with lots of tabs at the start as well.
Fix #840
2021-11-03 12:02:29 +09:00
Blaž Hrastnik
e5de103728
Extract a clear_completion method
2021-10-29 16:48:41 +09:00
Ivan Tham
49f6c2623f
Bump lsp-types to 0.91.0 ( #932 )
2021-10-29 12:00:18 +09:00
Blaž Hrastnik
1066b081dd
fix: When cycling through prompt history, update event needs to trigger
2021-10-27 18:23:17 +09:00
Omnikar
2505802d39
Improve statusline ( #916 )
...
* Improve statusline
* Change diagnostic count display to show counts of individual
diagnostic types next to their corresponding gutter dots.
* Add selection count to the statusline.
* Do not display info or hint count in statusline
* Reduce padding
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Reduce padding
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Use `Span::styled`
* Reduce padding
* Use `Style::patch`
* Remove unnecessary `Cow` creation
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2021-10-27 12:24:24 +09:00
CossonLeo
f331ba9df4
Clear competion items when start_offset > cursor ( #906 )
2021-10-26 09:42:37 +09:00
CossonLeo
b142fd4080
move_up will select last item, when no item selected ( #907 )
2021-10-26 09:42:23 +09:00
CossonLeo
bca98b5bed
Add c-j c-k to menu keymap for move_up move_down ( #908 )
2021-10-26 09:42:08 +09:00
Blaž Hrastnik
acc5ac5e73
fix warning
2021-10-25 11:11:11 +09:00
Blaž Hrastnik
3edca7854e
completion: fully revert state before apply & insertText common prefix
2021-10-25 11:09:09 +09:00
Blaž Hrastnik
cee7ad781e
Mark a few functions as const
2021-10-24 17:28:29 +09:00
Oskar Nehlin
0f886af4b9
Add commands for moving between splits with a direction ( #860 )
...
* Add commands for moving between splits with a direction
* Update keymaps
* Change picker mapping
* Add test and clean up some comments
2021-10-23 20:06:40 +09:00
Blaž Hrastnik
182a59b552
Update to rust 1.56 + 2021 edition
2021-10-22 12:15:18 +09:00
Daniel S Poulin
3b032e8e1f
First stab at ignoring compressed files from picker ( #767 )
2021-10-22 10:02:05 +09:00
VuiMuich
67829976fa
Add C-j
and C-k
to keybinds for picker ( #876 )
...
* Add `C-j` and `C-k` for moving down/up in pickers
* Add new binds to keymap doc
2021-10-19 18:37:38 +09:00
Blaž Hrastnik
0a6b60085a
Merge branch 'master' into debug
2021-10-17 13:51:56 +09:00
Blaž Hrastnik
2c0468ffd1
fix: If backspacing past the start offset, cancel completion
...
Refs #822
2021-10-16 18:43:07 +09:00
Blaž Hrastnik
f8f63c5508
Merge pull request #821 from helix-editor/idle-timer
...
Idle timer / Autocompletion
2021-10-10 22:11:01 +09:00
Blaž Hrastnik
76b1bbc23a
Allow trigger_offset to be unused for now
2021-10-10 12:33:22 +09:00
Leoi Hung Kin
a6852fb88f
Picker: Don't panick at move_up/move_down when matches is empty ( #818 )
2021-10-09 20:34:10 +09:00
Blaž Hrastnik
f692ede2b7
fix: Don't crash on empty completion, don't retrigger on close
2021-10-07 10:37:35 +09:00
Blaž Hrastnik
66f26e82ce
Filter the initial completion
2021-10-05 22:27:35 +09:00
Blaž Hrastnik
40abec80e1
Experiment with autocompletion on idle
2021-10-05 22:27:33 +09:00
Blaž Hrastnik
f99bea404f
idle timer wip
2021-10-05 22:27:10 +09:00
Dmitry Sharshakov
bf53aff27d
Merge branch 'master' into debug
2021-09-25 23:14:59 +03:00
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
2021-09-22 01:03:12 +09:00
kraem
4a003782a5
enable smart case regex search by default ( #761 )
2021-09-20 13:45:07 +09:00
Blaž Hrastnik
c7d6e4461f
fix: Wrap around the top of the picker menu when scrolling
...
Forgot to port the improvements in menu.rs
Fixes #734
2021-09-17 14:43:06 +09:00
Blaž Hrastnik
dd0b15e1f1
syntax: Properly handle injection-regex for language injections
2021-09-16 15:50:14 +09:00
Blaž Hrastnik
32977ed341
ui: Trigger recalculate_size per popup render so contents can readjust
2021-09-13 17:44:50 +09:00
Blaž Hrastnik
72cf86e462
Regex prompts should have a history with a specifiable register
2021-09-08 16:34:04 +09:00
CossonLeo
011f9aa47f
Optimize completion doc position. ( #691 )
...
* optimize completion doc's render
* optimize completion doc's render
* optimize completion doc position
* cargo fmt
* fix panic
* use saturating_sub
* fixs
* fix clippy
* limit completion doc max width 120
2021-09-08 16:33:59 +09:00
Blaž Hrastnik
2ce87968cd
ui: Be smarter about centering previews
...
Try centering the whole block. If the block is too big for the viewport,
then make sure that the first line is within the preview.
2021-09-08 14:19:25 +09:00
Dmitry Sharshakov
507a1f8dd6
Get breakpoint reports from debugger
2021-09-06 08:47:54 +03:00
Dmitry Sharshakov
0add0c5639
Make conditional logpoints underlined
2021-09-05 15:12:13 +03:00
Dmitry Sharshakov
2d35b7b99c
Normalize line in picker preview to avoid crash
2021-09-05 14:31:16 +03:00
Dmitry Sharshakov
0e1e4edc5e
different display for conditional logpoints
2021-09-05 08:51:33 +03:00
Dmitry Sharshakov
8a609047c3
Mouse command for editing logpoint
2021-09-05 08:50:03 +03:00
Dmitry Sharshakov
3b0ec750ff
Support editing breakpoint condition with right click
2021-09-05 08:14:17 +03:00
Gokul Soumya
183dcce992
Add a sticky mode for keymaps ( #635 )
2021-09-05 12:55:13 +09:00
Dmitry Sharshakov
1befbd076c
Add command for editing breakpoint condition
2021-09-04 22:57:58 +03:00
Dmitry Sharshakov
698583c241
Support setting breakpoints with mouse
2021-09-04 21:14:24 +03:00
Blaž Hrastnik
b997d2cdeb
dap: Allow setting breakpoints before starting the adapter
2021-09-03 13:26:30 +09:00
Dmitry Sharshakov
2c89107349
Fix crash when stack trace not loaded
...
Still doesn't address the issue though
2021-09-02 19:58:03 +03:00
Dmitry Sharshakov
5b20f6020a
Merge remote-tracking branch 'origin/master' into debug
...
Contains type fix on helix-term/src/ui/editor.rs:752:13
2021-08-31 21:29:11 +03:00
Blaž Hrastnik
a3bd80a6fa
ui: prompt: Avoid allocating a prompt name if it's a static string
2021-08-31 18:29:24 +09:00
gbaranski
9c5752cbac
fix: use .cursor() instead of .head
2021-08-30 12:03:10 -07:00
gbaranski
b590504143
fix: use head instead of anchor for relative line
2021-08-30 12:03:10 -07:00
Blaž Hrastnik
0b0b1d850a
dap: Stop comparing file paths per line number
2021-08-30 11:22:26 +09:00
Blaž Hrastnik
2c7b75475f
dap: refactor frame handling
2021-08-30 11:07:59 +09:00
Omnikar
03ad9e0bfa
Fix code indentation ( #671 )
2021-08-30 09:15:49 +09:00
Dmitry Sharshakov
b42631942b
Defaults in completions, better schema
2021-08-29 14:51:47 +03:00
Dmitry Sharshakov
f53d8411cb
Add extra annotations to completions
2021-08-29 14:06:36 +03:00
Dmitry Sharshakov
98fda6b8f0
better completion
2021-08-29 13:16:57 +03:00
Dmitry Sharshakov
9d2f2a9e32
Support multiple arguments for debug configs
2021-08-29 13:06:22 +03:00
Dmitry Sharshakov
2d42766a71
wip: refactor parameters in UI start
2021-08-29 10:23:36 +03:00
Dmitry Sharshakov
af657ef2ec
Fix lints
2021-08-28 19:15:13 +03:00
Dmitry Sharshakov
94901b8677
Customized completion for template parameters
2021-08-28 19:11:19 +03:00
Dmitry Sharshakov
ef155e62ef
Add filename autocomplete to template args
2021-08-28 15:36:16 +03:00
Dmitry Sharshakov
e315394631
Merge remote-tracking branch 'origin/master' into debug
2021-08-28 14:59:26 +03:00
Dmitry Sharshakov
8df6739759
New way of starting debug sessions
2021-08-28 14:23:54 +03:00
Dmitry Sharshakov
5e4da09be2
Don't let picker be too narrow
2021-08-28 13:55:52 +03:00
Dmitry Sharshakov
890b51b568
Paginated variables
2021-08-28 10:13:19 +03:00
CossonLeo
d6a9c2c0f6
Add ui.menu text style ( #664 )
...
* add menu text style
* add ui.menu.text ui.info ui.info.text to book
* change ui.menu.text to ui.menu
* fix book's ui.menu
2021-08-28 13:54:24 +09:00
Blaž Hrastnik
5cee3b634d
ui: prompt: Fix typing with alt
2021-08-27 16:39:52 +09:00
Grzegorz Baranski
cec5d437d8
fix: show current line number even if relative line is on ( #656 )
2021-08-26 23:18:33 +05:30
Stuart Hinson
6192f2fa25
Show hidden files in filename completer ( #648 )
...
also removes unnecessary clone
2021-08-27 00:30:47 +09:00
Dmitry Sharshakov
c7759a5aa0
Merge remote-tracking branch 'origin/master' into debug
2021-08-25 19:22:01 +03:00
Kirawi
b99db7c687
Move path util functions from helix-term to helix-core ( #650 )
2021-08-25 10:04:05 +09:00
Dmitry Sharshakov
5d3c69d565
Support logpoints
...
Tested with Node (Delve and LLDB do not support logpoints)
2021-08-24 08:47:20 +03:00
Blaž Hrastnik
bf5b9a9f35
ui: Tone down the preview highlight by adding a new scope
2021-08-24 13:25:39 +09:00
Blaž Hrastnik
e6cb183134
ui: Fix preview window padding: we want horizontal, not vertical
2021-08-24 13:25:39 +09:00
Blaž Hrastnik
a5c3c6c6a9
ui: Highlight line ranges in the preview
2021-08-24 13:25:39 +09:00
CossonLeo
490125f008
info component style config use ui.info ui.info.text ( #643 )
2021-08-24 09:58:19 +09:00
Dmitry Sharshakov
b78f70e602
show breakpoint condition in diagnostics
2021-08-22 15:52:05 +03:00
Dmitry Sharshakov
f247858055
Support conditional breakpoints
2021-08-22 15:06:27 +03:00
Kirawi
59e0ceef8c
better panic messages for when you're missing selection scopes ( #608 )
2021-08-22 11:15:33 +09:00
Dmitry Sharshakov
a938f5a87a
refactor: handle DAP events in editor main loop
2021-08-21 17:21:35 +03:00
Dmitry Sharshakov
3fc501c99f
Correctly display 1-based breakpoints
2021-08-21 15:17:25 +03:00
Dmitry Sharshakov
56bddb12f8
Highlight line number of stack pointer
2021-08-21 14:58:05 +03:00
Dmitry Sharshakov
5f5b383979
Fix clippy warnings
2021-08-21 14:35:53 +03:00
Dmitry Sharshakov
6458edecfd
Add stack pointer display when stopped
2021-08-21 14:15:29 +03:00
Gokul Soumya
f9375f449c
Refactor new Rect construction ( #575 )
...
* Refactor new Rect construction
Introduces methods that can be chained to construct new Rects
out of pre-existing ones
* Clamp x and y to edges in Rect chop methods
* Rename Rect clipping functions
2021-08-21 14:21:20 +09:00
Dmitry Sharshakov
c4970c617e
make CI green
2021-08-20 16:48:59 +03:00
Blaž Hrastnik
94a1951d40
Work towards a breakpoint UI
2021-08-20 13:51:38 +09:00
Blaž Hrastnik
68626b8f78
ui: Refactor styling a bit, ensure infobox is stylable
2021-08-20 10:58:44 +09:00
Blaž Hrastnik
cbd39d67a4
minor: Refactor commands.rs a bit more
2021-08-20 10:43:22 +09:00
Kirawi
da8810809a
use ui.text.focus
for the picker ( fix #622 )
2021-08-20 10:43:08 +09:00
Blaž Hrastnik
0595b0626a
Fix clippy attr
2021-08-19 16:05:05 +09:00
Blaž Hrastnik
5f8b1c7320
Avoid looking up ui.text per highlight range
2021-08-19 15:59:08 +09:00
Blaž Hrastnik
557fd86e71
Extract view.inner_area(), simplify render_focused_view_elements
2021-08-19 15:59:03 +09:00
Blaž Hrastnik
9776553ad0
Refactor view.first_line/first_col into view.offset (Position)
2021-08-19 12:52:07 +09:00
Blaž Hrastnik
12ea3888c5
fix: ui: Pin popups with no positioning to the initial cursor position
...
This avoids the floating popup following the cursor as we type.
2021-08-19 11:25:19 +09:00
Gokul Soumya
14c08e855f
Refactor infobox rendering and parsing ( #579 )
2021-08-17 09:25:48 +09:00
Grzegorz Baranski
78923496a6
feat: relative numbers ( #485 )
...
* 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
2021-08-16 11:11:53 +09:00
Blaž Hrastnik
4167201344
ui: picker: Position count according to input bar
2021-08-13 18:00:04 +09:00
Blaž Hrastnik
eb9ac0a743
ui: picker: Use ui.selection instead of ui.selection.primary
2021-08-13 17:59:47 +09:00
Blaž Hrastnik
f20dc1283d
ui: picker: Render matches/total counts
2021-08-13 17:56:37 +09:00
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
2021-08-12 16:00:42 +09:00
Dmitry Sharshakov
7d51805e94
Support primary clipboard ( #548 )
...
* 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>
2021-08-12 11:53:48 +09:00
Blaž Hrastnik
627b899315
ui: completion: Insert suggestions when tabbing over them
...
Fixes #498
2021-08-11 10:56:32 +09:00
Blaž Hrastnik
f917b5a441
ui: completion: Use sort_text to sort the completions
2021-08-11 10:56:32 +09:00
Dmitry Sharshakov
27b551d345
helix-term: handle scrolling when mouse is enabled ( #554 )
...
* 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>
2021-08-10 14:35:20 +09:00
Blaž Hrastnik
86209c93a3
Appease clippy
2021-08-10 10:58:46 +09:00
Blaž Hrastnik
0a7add4ad4
Only recalculate resize during rendering, this stops flashing on resize
2021-08-10 10:52:52 +09:00
Kirawi
815ee9e334
fix small terminal size panic with info popup ( #563 )
...
* fix small terminal size panic with info popup
* remove unused enumerator
* fix subtraction overflow panic
2021-08-09 15:46:58 +09:00
Blaž Hrastnik
a2ccfffda1
config: Rename [terminal] to [editor] and pass it into Editor
2021-08-08 14:10:01 +09:00
Blaž Hrastnik
b20a5c4c0e
ui: menu: Allow wrapping around on ctrl-p/shift tab
2021-08-06 11:22:23 +09:00
Blaž Hrastnik
62eb8c6b40
mouse: Remove verify_screen_coords, refactor primary selection modification
2021-07-30 16:52:14 +09:00
Blaž Hrastnik
6bb744aeac
Remove the jump
2021-07-30 16:52:10 +09:00
Dmitry Sharshakov
8361de45dc
Mouse selection support ( #509 )
...
* Initial mouse selection support
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Disable mouse event capture if editor crashes
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Translate screen coordinates to view position
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Select full lines by dragging on line numbers
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* editor: don't register dragging as a jump
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Count graphemes correctly
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Do not select lines when dragging on the line number bar
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Split out verify_screen_coords
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Do not iterate over the graphemes twice
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Switch view by clicking on it
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Add disable-mouse config option
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Support multiple selections with mouse
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Remove unnecessary check
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Refactor using match expression
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Rename local variable
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Rename mouse option
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Refactor code
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Fix dragging selection
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Fix crash when clicking past last line
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Count characters better
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Remove comparison not needed anymore
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Validate coordinates before resolving position
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Tidy up references to editor tree
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Better way to determine line end and avoid overflow
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Fix for last line
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* Add unit tests for text_pos_at_screen_coords
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
2021-07-30 16:52:00 +09:00
Nathan Vegdahl
a873e719d5
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
2021-07-28 14:11:08 -07:00
Gokul Soumya
1493313750
Show pending keys in status line ( #515 )
...
* Show pending keys and counts in status line
* Refactor pending key display
2021-07-28 13:57:07 +09:00
Nathan Vegdahl
f62ec6e51e
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
2021-07-26 11:19:10 -07:00
Gokul Soumya
88d6f65239
Allow multi key remappings in config file ( #454 )
...
* 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
2021-07-27 01:07:13 +09:00
Nathan Vegdahl
0883b4fae0
Collect some common patterns into methods on Range
.
2021-07-26 08:40:30 -07:00
Blaž Hrastnik
63e54e30a7
Implement in-memory prompt history
...
Implementation is similar to kakoune: we store the entries into
a register.
2021-07-26 11:19:33 +09:00
Nathan Vegdahl
43594049dd
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
2021-07-23 17:23:16 -07:00
Blaž Hrastnik
1789dfabfe
fix: ui/menu: Don't allow scrolling past the end of completion
...
Fixes #472
2021-07-23 18:12:33 +09:00
Blaž Hrastnik
817a7e0bd6
fix: Only try expanding directory completion if it makes sense
...
Fixes #487
2021-07-23 18:10:30 +09:00