-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): allow printing selected DDS messages to the console
The motivations for this change are: - easy debugging of DDS messages for yazi and plugin developers - allow external applications to monitor yazi events. In neovim specifically, there is a limitation that the stdout and stderr streams cannot be monitored when displaying an embedded terminal application. A second yazi instance could theoretically be started, but the ui does currently not work when there is no screen to draw on.
- Loading branch information
1 parent
aee65bc
commit 630d772
Showing
7 changed files
with
159 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/// The id of a peer in the DDS system. | ||
#[derive(Debug, PartialEq)] | ||
pub enum DDSPeer { | ||
/// Internally, `0` is used to represent all peers. | ||
All, | ||
One(u64), | ||
} | ||
|
||
impl DDSPeer { | ||
pub fn matches(&self, peer_id: u64) -> bool { | ||
match self { | ||
Self::All => true, | ||
Self::One(id) => *id == peer_id, | ||
} | ||
} | ||
} | ||
|
||
impl From<u64> for DDSPeer { | ||
fn from(value: u64) -> Self { | ||
match value { | ||
0 => Self::All, | ||
_ => Self::One(value), | ||
} | ||
} | ||
} |