Commit Graph

51 Commits

Author SHA1 Message Date
nyx
5878f4dbf0
implement fish like tab completion (#767)
* implement fish like tab completion

* grey the pv out and convert to lowercase

* run fmt

* do not tabcomplete if the user hits enter

* fix

* fix lints

* run docgen

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-01 16:01:01 -05:00
JEEVITHA KANNAN K S
11336cf9f1
chore: Add spacing before and after for tui titles (#706)
* Add spacing

* Use string instead of box::leak

* Update tui/src/state.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-10-31 14:14:17 -05:00
nyx
fc2d731754
do not exit linutil in confirmation prompt when q is pressed (#758)
* do not exit linutil in confirmation prompt when q is pressed

* remove cap support

* add ``ctrl + c`` exiting

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:49:08 -05:00
nyx
72dfb29969
dont allow the user to bring up the command desc if there is none (#753)
* dont allow the user to bring up the command desc if there is none

* obey our god lints

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:42:06 -05:00
nyx
52565e5ea1
clear the search bar if the user changes categories (#752)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:41:03 -05:00
nyx
38138334b7
dont allow scrolling when last line is visible (#729)
* dont allow scrolling when last line is visible

* apply changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:37:01 -05:00
nyx
1dcc3f3c99
allow scrolling past last entry / first entry (#727)
* allow scrolling past last entry

* Update tui/src/state.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* Update tui/src/state.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* apply changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* apply changes proposed by adam round 2

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* undo changes proposed by adam in scroll up and down funcs

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:35:53 -05:00
nyx
2d14a0a7b6
return user to their previous position if they exit a subdir (#725)
* return user to their previous position if they enter a subdir

* fix lint

* implement changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* add newline back

* coalesce `visit_stack` and `position_stack` (#6)

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: cartercanedy <99052281+cartercanedy@users.noreply.github.com>
2024-10-31 13:30:22 -05:00
nyx
0c8977192f
fix color bleeding (#723)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:27:13 -05:00
nyx
a5fd25f6af
organize shortcut list into a grid-like-pattern (#721)
* organize shortcut list into a grid-like-pattern

* increase minimum size

* add newline back to satisfy lint

* decrease to 25

* optimization

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* satisfy lint

* implement some changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:25:16 -05:00
Bernhard M. Wiedemann
b2fb33229b
Replace BUILD_DATE with CARGO_PKG_VERSION (#878)
to make builds reproducible.
See https://reproducible-builds.org/ for why this is good.
2024-10-31 13:22:17 -05:00
Adam Perkowski
4f7de594a6
🔍️ exiting search with Ctrl-C + better shortcut tips (#768) 2024-10-24 14:43:16 -05:00
Chris Titus
abebe9bee1
Merge pull request #633 from afonsofrancof:generic-popup-title
Made popup title customizable. The Script's preview title is now its command name
2024-10-08 15:21:29 -05:00
Adam Perkowski
f1ee0569c3
✏️ fix: ALL typos (#775) 2024-10-07 20:42:03 -05:00
afonsofrancof
34ffbc5e8d
Merge branch 'main' of ssh://github.com/ChrisTitusTech/linutil into generic-popup-title 2024-10-03 21:08:15 +01:00
JEEVITHA KANNAN K S
26d0adc829
Refact temp-dir (#749) 2024-10-03 14:20:50 -05:00
Adam Perkowski
3c4a5dcecd
vt100 patches (#743)
Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
2024-10-02 16:47:27 -05:00
cartercanedy
7cc38df7e1
Feat: confirmation prompts (#687)
* confirmation prompt

* actually implement scrolling

* finalize styling

* get rid of generics on AppState and Focus

* add bottom title as help text

* number formatting
2024-09-30 16:48:22 -05:00
JEEVITHA KANNAN K S
66b92c84b0
feat: Add scroll (#643)
* Add scroll

* Update running_command.rs

* Add hints, Up and Down to terminal
2024-09-30 15:46:05 -05:00
JEEVITHA KANNAN K S
b549510895
Fix selected-cmd bug (#638) 2024-09-30 15:23:16 -05:00
Afonso Franco F.
8111649c8c
Restore behaviour of closing the pop-up with "q" (#634)
I am so used to pressing q to quit everything.
Let me know if this is not desired, because I remember using it a lot,
so if it was removed maybe there was a reason?

Co-authored-by: Chris Titus <contact@christitus.com>
2024-09-30 15:12:16 -05:00
cartercanedy
a2480bf1bd
implement dynamic shortcut list sizing (#668)
* implement dynamic shortcut list sizing

* Remove all dynamic allocations from shortcut creation
2024-09-28 14:05:19 -05:00
afonsofrancof
77962e2a5c
Made popup title generic. Preview title is now the command name 2024-09-23 04:47:03 +01:00
Adam Perkowski
62bcac4853
feat(task list): task names shortcuts (#628)
* Rust setup

* Updated tasklists

* More space
2024-09-22 14:08:27 -05:00
JEEVITHA KANNAN K S
e8b208f2b4
Fix cd multi-selection (#626) 2024-09-22 13:24:06 -05:00
JEEVITHA KANNAN K S
8637adf373
Hints title refactor (#608) 2024-09-22 11:53:04 -05:00
JEEVITHA KANNAN K S
b69e823375
fix: Min-term panic (#607)
* Fix min-term panic

* Align center
2024-09-22 11:51:25 -05:00
Liam
aca42f2411
fix: Respect shebangs in scripts (#606)
* Cargo will rebuild if anything changes in src/, recursively. E.g src/commands/ is also checked

* No need to make a generic, we only use 1 backend

* Delete the imports that are no longer needed

* Replace the weird struct hack with an enum

* Delete a useless line

* The None should be explicit

* Support for non-english keyboard input

* Commit Linutil

* refactor: Improve conciseness of char passthrough

* fix: Respect shebang in script files

* refactor: More efficiently handle shebangs

* refactor: Remove unnecessary error handling

If 2 characters can be read from the file, a line must exist

* fix: Drop accidentally added file

* fix: Ensure that executable exists before displaying entry

* fix: Explicitly check if the executable is a file

* refactor: Replace unnecessary import

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* fix: Check whether the file is directly executable

* fix: Comply with rustfmt

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: Andrii Dokhniak <adokhniak@gmail.com>
Co-authored-by: JustLinuxUser <JustLinuxUser@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-09-22 11:50:43 -05:00
Liam
446d52ce7c
fix: Correctly enter up directories (..) (#598) 2024-09-22 11:11:43 -05:00
Adam Perkowski
f6748caab7
feat: short disclaimer-like script descriptions (#593)
* names updated

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>

* idea

* Added missing tasks

* Added a title

---------

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
2024-09-22 11:10:05 -05:00
cartercanedy
76a4ffc70e
feat: implement syntax highlighting for preview text (#568)
* implement syntax highlighting for preview text

* remove errant lifetimes

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* remove errant lifetimes

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* update Cargo.lock

* only iterate over visible lines

* break lines up on init

* implement side scrolling

* Remove unnecessary #![soft_unstable]

This was accidentally left in from benching

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-09-22 10:56:30 -05:00
Adam Perkowski
f2332a7da2
Fixed some Rust code structure and modified the workflow to fail if clippy returns warnings (#569)
* Fixed someone else's mistakes

* workflow now fails if clippy returns warnings

* refactor: Make base title variable constant

---------

Co-authored-by: Liam <lj3954@users.noreply.github.com>
2024-09-21 09:08:24 -05:00
Liam
1d5807ad51
Refactor tips (#575)
* refactor: Move all get_random_tip functionality to its own function

* fix: Only depend on rand when building the tips feature
2024-09-20 19:12:26 -05:00
Adam Perkowski
1a21753831
Moved tips to a feature (#566) 2024-09-20 10:48:09 -05:00
Guru Swarupa
4d6d1b22f0
added tips. (#565)
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-09-20 10:09:08 -05:00
Chris Titus
eb192d23ba
Revert "Removed an unused var (#535)" (#538)
This reverts commit 8397b04472.
2024-09-19 13:44:04 -05:00
Adam Perkowski
8397b04472
Removed an unused var (#535) 2024-09-19 13:42:50 -05:00
JEEVITHA KANNAN K S
176ce1f4b9
Seperate style and title variables (#537)
Added lj's thought process from https://github.com/ChrisTitusTech/linutil/pull/490

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-09-19 13:41:23 -05:00
Adam Perkowski
d0ff354c49
Collapsed if statements (#534) 2024-09-19 13:29:08 -05:00
Liam
a5b3df0776
Refactor various components of Rust code (#490)
* refactor: Simplify hint code, replacing while loop with fold iterator

* refactor: Add spacing to lines in a separate function

* refactor: Replace if let with map_or for better readability

* refactor: Remove unnecessary duplicate body from is_cmd function

* refactor: Create generic function to replace duplicate get_selected code

* refactor: Remove duplicate code, remove unnecessary nesting

* refactor: Move style into its own variable

* refactor: Use constants for min width and height

* refactor: Remove pointless duplicate variable

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-09-19 13:18:55 -05:00
JEEVITHA KANNAN K S
a747f80c85
feat: Multi selection and installation (#338)
* Fix conflicts

* Fix cmd running when selected is directory

* Clean comments
2024-09-19 13:15:30 -05:00
JEEVITHA KANNAN K S
831f71bf43
Fix description and preview hints (#495) 2024-09-19 12:24:56 -05:00
JEEVITHA KANNAN K S
197f359c45
Refactor tab (#347)
Co-authored-by: Chris Titus <contact@christitus.com>
2024-09-18 21:22:43 -05:00
cartercanedy
1ea326747a
fix: Fixup preview rendering and logic of preview key binding being shown in shortcut list (#387)
* always check if selection is a command if list is focused

* clear float widget render area before rendering content

* Update hint.rs

* Update floating_text.rs

Thanks to @jeevithakannan2 for idea

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-09-18 21:00:09 -05:00
JEEVITHA KANNAN K S
a7e6ea0246
feat: Command Description (#437)
* Implement about page

Add title

Add hints

* Add descriptions for commands

* Refactor about to description
2024-09-18 19:17:08 -05:00
JEEVITHA KANNAN K S
fde25afcbd
feat: Implement minimum TUI size (#425)
* Implement minimum size

* Update tui/src/state.rs

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: Chris Titus <contact@christitus.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-09-18 13:49:33 -05:00
Chris Titus
0eafa7b54c
Merge branch 'main' into testing-9 2024-09-18 13:02:19 -05:00
nnyyxxxx
3f67abc918 fix typos 2024-09-14 11:30:03 -04:00
Carter Canedy
84b5a2ebdd exit on control-c chord, don't exit preview on q keypress, remove superfluous screen clear and cursor position reset 2024-09-13 12:27:34 -07:00
Liam
82b89efdb2
Merge remote-tracking branch 'upstream/main' into restructure_linutil 2024-09-11 15:21:50 -07:00