Commit Graph

553 Commits

Author SHA1 Message Date
maxomatic458
cc9a957184
fix ide menu not reporting correct required_lines (#781)
* fix ide menu not reporting correct required_lines

* format
2024-04-22 11:14:01 -07:00
Stefan Holderbach
ced60e57cd
Remove debug print (#784) 2024-04-22 08:04:37 -05:00
Darren Schroeder
46f410bfdc
add bashism !term to prefix search for last command beginning with term (#779)
* add bashism `!term` to prefix search for last command beginning with `term`

* missed doc comment

* one more try with doc comments

* add ability to search session first, then globally

* unrelates types for list_menu test

* missed on
2024-04-12 15:36:53 -04:00
Stefan Holderbach
9853df3126
Bump version for 0.31.0 release (#780) 2024-04-02 20:05:51 +03:00
Stefan Holderbach
b7209b6872
Fix case-consistency searching sqlite history (#777)
* Fix case-consistency searching sqlite history

For the `FileBackedHistory` those operations have always been case
sensitive, do the same for `SqliteBackedHistory`. The insensitivity of
`like` in sqlite causes https://github.com/nushell/nushell/issues/10131

For substring matching for now use `glob` instead of `like`, this
changes the wildcard from `%` to `*` which is more common in the Nushell
context. We have so far not been performing proper escaping here. User
queries may match more often in surprising ways.

`Exact` should now be exact.

* Add test for case-sensitive prefix search

Link the relevant issue so feature fans don't reintroduce bugs

* Use sqlite `instr` function for case-exact match

* Remove outdated fixme
2024-03-27 22:04:03 +01:00
Stefan Holderbach
21903cc0c4
Bump fd-lock requirement and locked deps (#775) 2024-03-25 22:57:38 +01:00
Stefan Holderbach
a87a4e24d8
Fix OpenOptions clippy (#776)
`truncate(false)` is the right choice as we manually truncate later. (we
want to read from the same handle first and then write, to use the
advisory lock)
2024-03-25 22:54:43 +01:00
Darren Schroeder
6957b5ab7b
Revert "Move left when exiting insert mode (#699)" (#773)
Simulating vim's cursor logic by moving the actual cursor breaks the history traversal. Thus revert.

This reverts commit 02f551d42e.
2024-03-19 11:04:17 +01:00
Tastaturtaste
dc7063ea42
Use the OS clipboard only for explicit cut/copy/paste operations (#761)
* Use the system-clipboard only for explicit cut/copy/paste operation

* Update reedline to use the system-clipboard only for explicit cut/copy/paste operation

* Use separate variants to differentiate between local cut buffer and system clipboard. Compile out all system clipboard functionality statically if feature is not active.
2024-03-12 20:40:08 +01:00
Stefan Holderbach
0698712701
Bump version of strum/strum_macros (#768)
Most recent minor version: 0.26
Should be the same as nushell to reduce dependency duplication
2024-03-10 19:22:09 +01:00
Stefan Holderbach
d12357bcbe
Bump version for 0.30.0 release (#762) 2024-03-05 20:43:16 +01:00
Stefan Holderbach
bf0e6d9cb2
Bump dependencies in lockfile (#764)
Motivated by advisory for transitive dependency `mio`
https://rustsec.org/advisories/RUSTSEC-2024-0019.html

This does not have a direct effect on library users.
2024-03-05 20:43:01 +01:00
KITAGAWA Yasutaka
4fd129588a
Fix rendering prompt after ExecuteHostCommand (#758)
* Fix rendering prompt after ExecuteHostCommand

* Update src/engine.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

* Rename

---------

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2024-02-27 08:27:34 -06:00
icp
c7c17442e0
Bump rusqlite from 0.29.0 to 0.31.0 (#754) 2024-02-17 09:13:29 -06:00
Tastaturtaste
f773192e53
Fix logic error in style_range leading to overflow on subtraction (#751) 2024-02-12 13:06:05 -06:00
andreistan26
02f551d42e
Move left when exiting insert mode (#699)
Signed-off-by: Andrei Stan <andreistan2003@gmail.com>
2024-02-09 13:53:44 -08:00
Sebastian Witte
ab1b47ef40
Remove duplicates from file based history search (#741) 2024-02-09 06:23:33 -06:00
Paul Buehne
e0aa40a1aa
Fix typos and grammar mistakes (#743)
* Fix typos and grammar mistakes

* Fix broken test for "remove_last_char_works_with_normal_string"

I accidentally "fixed" the missing char in the previous commit.
2024-02-08 07:00:30 -06:00
Jakub Žádník
62fdea8158
Bump to version 0.29 (#742) 2024-02-06 20:44:16 +02:00
maxomatic458
f2447364b9
fix description line not truncating in columnar menu (#739)
* add builder functions

* fix description wrap

* fmt

* fix
2024-02-02 17:59:12 -06:00
Steven
9f0095f150
revert overdeleted binding from #715 (#734) 2024-01-30 10:49:13 -06:00
nibon7
a5d3c353ec
Fix quick completion (#732) 2024-01-29 13:07:27 -06:00
maxomatic458
090af4d323
add builder functions (#731) 2024-01-29 08:31:07 -06:00
maxomatic458
34af84ebe0
Typed text style (#730)
* add match style to MenuTextStyle

* cargo fmt

* fix external style
2024-01-28 21:36:58 -08:00
maxomatic458
c8a52a85f1
menu refactor (#723)
* get correct cursor pos when menu indicator contains newline

* add tests

* fix cursor pos in multiline prompt

* make description mode enum public

* add doc comment

* respect windows newline in update_values

* Revert "respect windows newline in update_values"

This reverts commit 070d600545.

* add complete_with_base_ranges to Completer

* add builder for correct_cursor_pos

* add config options to completion examples

* add style to ide menu

* run fmt

* start menu refactor

* Revert "start menu refactor"

This reverts commit 62726f29be.

* start menu refactor

* fix ci

* use MenuSettings struct

* add test case for unix newline

* more tests

* fix newline replace

* add explicit panic to stay backwards compatible

* fix ci

* Update columnar_menu.rs

Co-authored-by: Yash Thakur <45539777+ysthakur@users.noreply.github.com>

---------

Co-authored-by: Yash Thakur <45539777+ysthakur@users.noreply.github.com>
2024-01-28 08:01:16 -08:00
Yash Thakur
a8e494f24a
Print foreground for indicator & right prompt for large buffers (#728) 2024-01-27 18:36:56 -06:00
maxomatic458
42bcd61b47
Fix style in ide menu (#725)
* get correct cursor pos when menu indicator contains newline

* add tests

* fix cursor pos in multiline prompt

* make description mode enum public

* add doc comment

* respect windows newline in update_values

* Revert "respect windows newline in update_values"

This reverts commit 070d600545.

* add complete_with_base_ranges to Completer

* add builder for correct_cursor_pos

* add config options to completion examples

* add style to ide menu

* run fmt

* start menu refactor

* Revert "start menu refactor"

This reverts commit 62726f29be.

* fix style
2024-01-26 07:29:56 -06:00
maxomatic458
03a1baba6c
add style from #691 to ide menu (#722)
* get correct cursor pos when menu indicator contains newline

* add tests

* fix cursor pos in multiline prompt

* make description mode enum public

* add doc comment

* respect windows newline in update_values

* Revert "respect windows newline in update_values"

This reverts commit 070d600545.

* add complete_with_base_ranges to Completer

* add builder for correct_cursor_pos

* add config options to completion examples

* add style to ide menu

* run fmt

* start menu refactor

* Revert "start menu refactor"

This reverts commit 62726f29be.
2024-01-25 17:25:32 -08:00
Michael Angerman
3f6f0d1c3d
update history error message (#721) 2024-01-25 11:05:50 -08:00
nibon7
7069448050
Don't panic when creating FileBackedHistory with usize::MAX capacity (#701) 2024-01-25 09:53:18 -08:00
Ralf Steube
3bee07cfbd
columnar_menu: fix explicit highlighting color (#720) 2024-01-24 17:51:12 -06:00
Ralf Steube
7adffd533c
suggestion: added style (#691)
* suggestion: added style

supports reverse highlighting using nu.config

```nushell
style: {
    text: white
    selected_text: {
        attr: r
    }
    description_text: white_dimmed
}
```

* added reset

* fix clippy
2024-01-23 21:02:14 -08:00
Antoine Büsch
7d08fc8d29
Clipboard graceful handling (#712)
* Gracefully handled lack of system clipboard

If the `system_clipboard` feature is enabled, but we failed to
initialize the `SystemClipboard`, default to `LocalClipboard` instead of
panicking.

* Remove `eprintln!()` when failing to access system clipboard
2024-01-23 11:25:28 +02:00
Michael Angerman
ede2defbfe
update the ide_completions example with more cases to explore (#718) 2024-01-22 14:09:59 -08:00
maxomatic458
cbb56e25d0
get back the ranges of the strings from the completer used for generating completions (#713)
* get correct cursor pos when menu indicator contains newline

* add tests

* fix cursor pos in multiline prompt

* make description mode enum public

* add doc comment

* respect windows newline in update_values

* Revert "respect windows newline in update_values"

This reverts commit 070d600545.

* add complete_with_base_ranges to Completer

* add builder for correct_cursor_pos

* add config options to completion examples
2024-01-22 13:08:52 -08:00
Jakub Žádník
32a391675d
Update dependencies (#717) 2024-01-22 14:19:32 -06:00
Tastaturtaste
135dd5202f
Remove conflicting keybindings added with https://github.com/nushell/reedline/pull/689#issue-2057714568, to fix https://github.com/nushell/nushell/issues/11600#issue-2092758889 (#715) 2024-01-22 14:17:45 -06:00
Jakub Žádník
a46c41cfa3
Update nu-ansi-term to 0.50.0 (#716) 2024-01-22 21:22:00 +02:00
andreistan26
d9db6a84b7
Fix panic when history size set to 0 (#653)
* Fix file based history when capacity is set to zero

Signed-off-by: Andrei Stan <andreistan2003@gmail.com>

* Fix CI

Signed-off-by: Andrei Stan <andreistan2003@gmail.com>

---------

Signed-off-by: Andrei Stan <andreistan2003@gmail.com>
2024-01-20 19:25:02 -08:00
Michael Angerman
7255741290
remove codecov.yml in the reedline repo (#710)
* remove codecov.yml

* remove uploading code coverage in the ci.yml

* add back in codecov.yml and see if just removing the action in the ci.yml works
2024-01-20 19:08:49 -08:00
maxomatic458
9ca229de32
get correct cursor pos when menu indicator contains newline (#708) 2024-01-20 13:17:29 -06:00
maxomatic458
a3769f9b98
respect windows newline in update_values (#709) 2024-01-20 12:17:53 -06:00
maxomatic458
31eaeeb231
ide style completions (#696)
* ide style completions

* descriptions

* truncate suggestion & description

* border width

* clippy & typos

* run cargo fmt

* add with_description_offset to builder

* fix empty description

* minimize description padding

* rework working details handling + fix CI

* add tests + change split function

* fix multiline prompt cursor pos
2024-01-18 10:37:06 -06:00
Tastaturtaste
2f3eb3e82f
Add ability to select and cut text in the input buffer (#689)
* Add ability to select and cut text in the input buffer

* Add visual selection effect

* Add SelectMoveWord<Left/Right> command on Shift + Ctrl + Arrow

* Add ability to delete selection with EditCommands 'Delete' and 'Backspace'

* Make selection an option on every move EditCommand

* Add display text for optional 'select' parameter to move EditCommands
2024-01-17 12:03:42 -06:00
Tastaturtaste
dc27ed8ff4
Replace clipboard with arboard, which is actively maintained (#705) 2024-01-14 17:59:59 -06:00
Darren Schroeder
ef7b96c157
Revert "Fix move to line start in multi-line history entries" (#704) 2024-01-11 15:41:29 -06:00
Yash Thakur
0c5f981746
Don't slice line in DefaultCompleter (#695)
* Don't slice line in DefaultCompleter

* Revert completions example

* Fix clippy lint

* Treat input as '' if None

* Update values even if string_difference empty

* Rename start to pos in list_menu

* Fix string_diff bug with repeated char

* Trim before completing in DefaultCompleter

* Remove TODO

* Make HistoryCompleter take end as pos
2024-01-11 10:13:20 -06:00
Yash Thakur
3e2c0fef3b
Print after cursor until newline (#700) 2024-01-11 09:29:07 -06:00
Mark Murphy
7404f70bf7
Fix move to line start in multi-line history entries (#584)
* Add move-to-line-start tests

* Fix #582 edit commands jumping to end of buffer after history navigation

* Fix formatting
2024-01-11 08:16:06 -06:00
Clément Nerma
b2f265014d
Make ReedlineErrorVariants public (#679)
* Make `ReedlineErrorVariants` public

* Fix: add missing comments
2024-01-11 08:11:58 -06:00