-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dff8035
commit 6d48c87
Showing
4 changed files
with
140 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,71 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use strum::Display; | ||
|
||
/// The different actions that can be performed by the application. | ||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Display)] | ||
pub enum Action { | ||
// input actions | ||
/// Add a character to the input buffer. | ||
AddInputChar(char), | ||
/// Delete the character before the cursor from the input buffer. | ||
DeletePrevChar, | ||
/// Delete the character after the cursor from the input buffer. | ||
DeleteNextChar, | ||
/// Move the cursor to the character before the current cursor position. | ||
GoToPrevChar, | ||
/// Move the cursor to the character after the current cursor position. | ||
GoToNextChar, | ||
/// Move the cursor to the start of the input buffer. | ||
GoToInputStart, | ||
/// Move the cursor to the end of the input buffer. | ||
GoToInputEnd, | ||
// rendering actions | ||
/// Render the terminal user interface screen. | ||
Render, | ||
/// Resize the terminal user interface screen to the given dimensions. | ||
Resize(u16, u16), | ||
/// Clear the terminal user interface screen. | ||
ClearScreen, | ||
// results actions | ||
/// Select the entry currently under the cursor. | ||
SelectEntry, | ||
/// Select the entry currently under the cursor and exit the application. | ||
SelectAndExit, | ||
/// Select the next entry in the currently focused list. | ||
SelectNextEntry, | ||
/// Select the previous entry in the currently focused list. | ||
SelectPrevEntry, | ||
/// Copy the currently selected entry to the clipboard. | ||
CopyEntryToClipboard, | ||
// navigation actions | ||
GoToPaneUp, | ||
GoToPaneDown, | ||
GoToPaneLeft, | ||
GoToPaneRight, | ||
GoToNextPane, | ||
GoToPrevPane, | ||
// preview actions | ||
/// Scroll the preview up by one line. | ||
ScrollPreviewUp, | ||
/// Scroll the preview down by one line. | ||
ScrollPreviewDown, | ||
/// Scroll the preview up by half a page. | ||
ScrollPreviewHalfPageUp, | ||
/// Scroll the preview down by half a page. | ||
ScrollPreviewHalfPageDown, | ||
/// Open the currently selected entry in the default application. | ||
OpenEntry, | ||
// application actions | ||
/// Tick the application state. | ||
Tick, | ||
/// Suspend the application. | ||
Suspend, | ||
/// Resume the application. | ||
Resume, | ||
/// Quit the application. | ||
Quit, | ||
/// Toggle the help screen. | ||
Help, | ||
/// Signal an error with the given message. | ||
Error(String), | ||
/// No operation. | ||
NoOp, | ||
// channel actions | ||
/// Toggle the remote control channel. | ||
ToggleRemoteControl, | ||
/// Toggle the remote control in `send to channel` mode. | ||
ToggleSendToChannel, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters