mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-13 00:20:08 +01:00
fix: obey clippy
This commit is contained in:
parent
272d293881
commit
8eaec9f933
2 changed files with 8 additions and 8 deletions
14
src/tmux.rs
14
src/tmux.rs
|
|
@ -93,13 +93,13 @@ impl Pane {
|
||||||
/// is the last line at the bottom of the pane.
|
/// is the last line at the bottom of the pane.
|
||||||
///
|
///
|
||||||
/// - In normal mode, the index of the start line is always 0. The index of
|
/// - In normal mode, the index of the start line is always 0. The index of
|
||||||
/// the end line is always the pane's height minus one. These do not need to
|
/// the end line is always the pane's height minus one. These do not need to
|
||||||
/// be specified when capturing the pane's content.
|
/// be specified when capturing the pane's content.
|
||||||
///
|
///
|
||||||
/// - If navigating history in copy mode, the index of the start line is the
|
/// - In normal mode, the index of the start line is always 0. The index of
|
||||||
/// opposite of the pane's scroll position. For instance a pane of 40 lines,
|
/// the end line is always the pane's height minus one. These do not need to
|
||||||
/// scrolled up by 3 lines. It is necessarily in copy mode. Its start line
|
/// be specified when capturing the pane's content.
|
||||||
/// index is `-3`. The index of the last line is `(40-1) - 3 = 36`.
|
/// index is `-3`. The index of the last line is `(40-1) - 3 = 36`.
|
||||||
///
|
///
|
||||||
pub fn capture(&self, region: &CaptureRegion) -> Result<String> {
|
pub fn capture(&self, region: &CaptureRegion) -> Result<String> {
|
||||||
let mut args_str = format!("capture-pane -t {pane_id} -J -p", pane_id = self.id);
|
let mut args_str = format!("capture-pane -t {pane_id} -J -p", pane_id = self.id);
|
||||||
|
|
@ -222,7 +222,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_pass() {
|
fn test_parse_pass() {
|
||||||
let output = vec!["%52:false:62:3:false", "%53:false:23::true"];
|
let output = ["%52:false:62:3:false", "%53:false:23::true"];
|
||||||
let panes: Result<Vec<Pane>> = output.iter().map(|&line| Pane::from_str(line)).collect();
|
let panes: Result<Vec<Pane>> = output.iter().map(|&line| Pane::from_str(line)).collect();
|
||||||
let panes = panes.expect("Could not parse tmux panes");
|
let panes = panes.expect("Could not parse tmux panes");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use crate::{config::extended::OutputDestination, textbuf};
|
||||||
///
|
///
|
||||||
/// - the first `WrappedLine` has `pos_y: 0` and `size: 1`
|
/// - the first `WrappedLine` has `pos_y: 0` and `size: 1`
|
||||||
/// - the second `WrappedLine` has `pos_y: 1` and `size: 2` (larger than screen
|
/// - the second `WrappedLine` has `pos_y: 1` and `size: 2` (larger than screen
|
||||||
/// width)
|
/// width)
|
||||||
/// - the third `WrappedLine` has `pos_y: 3` and `size: 1`
|
/// - the third `WrappedLine` has `pos_y: 3` and `size: 1`
|
||||||
///
|
///
|
||||||
struct WrappedLine {
|
struct WrappedLine {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue