id stringlengths 20 30 | source stringclasses 1
value | chunk_index int64 0 520k | token_count int32 154 512 | content stringlengths 185 57.5k |
|---|---|---|---|---|
rust_dataset_chunk_515800 | rust_dataset.txt | 515,800 | 512 | assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(5))
.unwrap()
.position_and_size()
.rows
.as_usize(),
5,
"pane 5 row count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&P... |
rust_dataset_chunk_515801 | rust_dataset.txt | 515,801 | 512 | tab.horizontal_split(PaneId::Terminal(2), None, 1, None, None)
.unwrap();
tab.horizontal_split(PaneId::Terminal(3), None, 1, None, None)
.unwrap();
tab.vertical_split(PaneId::Terminal(4), None, 1, None, None)
.unwrap();
tab.move_focus_up(1).unwrap();
tab.vertical_split(PaneId::T... |
rust_dataset_chunk_515802 | rust_dataset.txt | 515,802 | 512 | y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.cols
.as_usize(),
67,
"pane 2 column count"
);
assert_eq!(
tab.tiled_panes
.pa... |
rust_dataset_chunk_515803 | rust_dataset.txt | 515,803 | 512 | as_usize(),
60,
"pane 4 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(4))
.unwrap()
.position_and_size()
.rows
.as_usize(),
5,
"pane 4 row count"
);
assert_eq!(
... |
rust_dataset_chunk_515804 | rust_dataset.txt | 515,804 | 512 | ()
.position_and_size()
.rows
.as_usize(),
10,
"pane 6 row count"
);
}
#[test]
pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_panes_above_and_below() {
// ┌─────┬─────┐ ┌─────┬─────┐
// ├─────┼─────┤ ... |
rust_dataset_chunk_515805 | rust_dataset.txt | 515,805 | 512 | (&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.x,
0,
"pane 1 x position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.y,
0,
... |
rust_dataset_chunk_515806 | rust_dataset.txt | 515,806 | 512 | .panes
.get(&PaneId::Terminal(3))
.unwrap()
.position_and_size()
.y,
52,
"pane 3 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(3))
.unwrap()
.position_and_size()
... |
rust_dataset_chunk_515807 | rust_dataset.txt | 515,807 | 512 | tab.tiled_panes
.panes
.get(&PaneId::Terminal(5))
.unwrap()
.position_and_size()
.cols
.as_usize(),
60,
"pane 5 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(5))
... |
rust_dataset_chunk_515808 | rust_dataset.txt | 515,808 | 512 | pane 7 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(7))
.unwrap()
.position_and_size()
.rows
.as_usize(),
5,
"pane 7 row count"
);
assert_eq!(
tab.tiled_panes
... |
rust_dataset_chunk_515809 | rust_dataset.txt | 515,809 | 512 | let stacked_resize = true;
let mut tab = create_new_tab(size, stacked_resize);
tab.horizontal_split(PaneId::Terminal(2), None, 1, None, None)
.unwrap();
tab.horizontal_split(PaneId::Terminal(3), None, 1, None, None)
.unwrap();
tab.vertical_split(PaneId::Terminal(4), None, 1, None, None)... |
rust_dataset_chunk_515810 | rust_dataset.txt | 515,810 | 512 | es
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.x,
0,
"pane 2 x position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
... |
rust_dataset_chunk_515811 | rust_dataset.txt | 515,811 | 512 | iled_panes
.panes
.get(&PaneId::Terminal(4))
.unwrap()
.position_and_size()
.y,
52,
"pane 4 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(4))
.unwrap()
.... |
rust_dataset_chunk_515812 | rust_dataset.txt | 515,812 | 512 | assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(6))
.unwrap()
.position_and_size()
.cols
.as_usize(),
54,
"pane 6 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get... |
rust_dataset_chunk_515813 | rust_dataset.txt | 515,813 | 512 | 67,
"pane 8 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(8))
.unwrap()
.position_and_size()
.rows
.as_usize(),
5,
"pane 8 row count"
);
}
#[test]
pub fn cannot_resize_right... |
rust_dataset_chunk_515814 | rust_dataset.txt | 515,814 | 512 | mut initial_layout = TiledPaneLayout::default();
initial_layout.children_split_direction = SplitDirection::Vertical;
let mut fixed_child = TiledPaneLayout::default();
fixed_child.split_size = Some(SplitSize::Fixed(60));
initial_layout.children = vec![fixed_child, TiledPaneLayout::default()];
let mu... |
rust_dataset_chunk_515815 | rust_dataset.txt | 515,815 | 512 | unwrap()
.position_and_size()
.y,
0,
"pane 1 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.cols
.as_usize(),
121,
... |
rust_dataset_chunk_515816 | rust_dataset.txt | 515,816 | 512 | cols: 121,
rows: 20,
};
let stacked_resize = true;
let mut tab = create_new_tab(size, stacked_resize);
tab.horizontal_split(PaneId::Terminal(2), None, 1, None, None)
.unwrap();
tab.move_focus_up(1).unwrap();
tab_resize_up(&mut tab, 1);
assert_eq!(
tab.tiled_p... |
rust_dataset_chunk_515817 | rust_dataset.txt | 515,817 | 512 | unwrap()
.position_and_size()
.rows
.as_usize(),
11,
"pane 2 row count"
);
}
#[test]
pub fn resize_up_with_panes_above_and_below() {
// ┌───────────┐ ┌───────────┐
// │ │ │ │
// │ │ ... |
rust_dataset_chunk_515818 | rust_dataset.txt | 515,818 | 512 | .unwrap()
.position_and_size()
.rows
.as_usize(),
13,
"pane 1 row count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.x,
0,
... |
rust_dataset_chunk_515819 | rust_dataset.txt | 515,819 | 512 | //
// ┌─────┬─────┐ ┌─────┬─────┐
// │ │ │ ├─────┴─────┤
// ├─────┴─────┤ ==resize=up==> │███████████│
// │███████████│ │███████████│
// └───────────┘ └───────────┘
// █ == focused pane
let size = Size {
col... |
rust_dataset_chunk_515820 | rust_dataset.txt | 515,820 | 512 | x position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.y,
14,
"pane 2 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId:... |
rust_dataset_chunk_515821 | rust_dataset.txt | 515,821 | 512 | │█████│
// └─────┴─────┘ └─────┴─────┘
// █ == focused pane
let size = Size {
cols: 121,
rows: 30,
};
let stacked_resize = true;
let mut tab = create_new_tab(size, stacked_resize);
tab.horizontal_split(PaneId::Terminal(2), None, 1, None, None)
.unwra... |
rust_dataset_chunk_515822 | rust_dataset.txt | 515,822 | 512 | 15,
"pane 2 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.cols
.as_usize(),
61,
"pane 2 column count"
);
assert_eq!(
tab.tiled_pa... |
rust_dataset_chunk_515823 | rust_dataset.txt | 515,823 | 512 | ()
.cols
.as_usize(),
60,
"pane 4 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(4))
.unwrap()
.position_and_size()
.rows
.as_usize(),
16,
"pane 4 r... |
rust_dataset_chunk_515824 | rust_dataset.txt | 515,824 | 512 | );
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.cols
.as_usize(),
61,
"pane 1 column count"
);
assert_eq!(
tab.tiled_panes
.panes
... |
rust_dataset_chunk_515825 | rust_dataset.txt | 515,825 | 512 | (),
60,
"pane 3 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(3))
.unwrap()
.position_and_size()
.rows
.as_usize(),
14,
"pane 3 row count"
);
assert_eq!(
... |
rust_dataset_chunk_515826 | rust_dataset.txt | 515,826 | 512 | );
tab.horizontal_split(PaneId::Terminal(2), None, 1, None, None)
.unwrap();
tab.move_focus_up(1).unwrap();
tab.vertical_split(PaneId::Terminal(3), None, 1, None, None)
.unwrap();
tab.move_focus_down(1).unwrap();
tab.vertical_split(PaneId::Terminal(4), None, 1, None, None)
.u... |
rust_dataset_chunk_515827 | rust_dataset.txt | 515,827 | 512 | pane 2 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.rows
.as_usize(),
16,
"pane 2 row count"
);
assert_eq!(
tab.tiled_panes
... |
rust_dataset_chunk_515828 | rust_dataset.txt | 515,828 | 512 |
.as_usize(),
15,
"pane 4 row count"
);
}
#[test]
pub fn resize_up_with_panes_below_aligned_right_with_current_pane() {
// ┌─────┬─────┐ ┌─────┬─────┐
// │█████│ │ │█████│ │
// │█████│ │ ├─────┤ │
// ├───... |
rust_dataset_chunk_515829 | rust_dataset.txt | 515,829 | 512 | pane 1 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.rows
.as_usize(),
14,
"pane 1 row count"
);
assert_eq!(
tab.tiled_panes
... |
rust_dataset_chunk_515830 | rust_dataset.txt | 515,830 | 512 |
.as_usize(),
15,
"pane 3 row count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(4))
.unwrap()
.position_and_size()
.x,
61,
"pane 4 x position"
);
assert_eq!(
tab.til... |
rust_dataset_chunk_515831 | rust_dataset.txt | 515,831 | 512 | 1, None, None)
.unwrap();
tab.vertical_split(PaneId::Terminal(3), None, 1, None, None)
.unwrap();
tab.vertical_split(PaneId::Terminal(4), None, 1, None, None)
.unwrap();
tab.move_focus_up(1).unwrap();
tab.vertical_split(PaneId::Terminal(5), None, 1, None, None)
.unwrap();... |
rust_dataset_chunk_515832 | rust_dataset.txt | 515,832 | 512 | unwrap()
.position_and_size()
.cols
.as_usize(),
61,
"pane 2 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.rows
.as... |
rust_dataset_chunk_515833 | rust_dataset.txt | 515,833 | 512 | .get(&PaneId::Terminal(4))
.unwrap()
.position_and_size()
.rows
.as_usize(),
15,
"pane 4 row count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(5))
.unwrap()
.pos... |
rust_dataset_chunk_515834 | rust_dataset.txt | 515,834 | 512 | ]
pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() {
// ┌───┬───┬───┐ ┌───┬───┬───┐
// │ │███│ │ │ │███│ │
// │ │███│ │ │ ├───┤ │
// ├───┼───┼───┤ ==resize=up==> ├───┤ ├───┤
// │ │ │ │ ... |
rust_dataset_chunk_515835 | rust_dataset.txt | 515,835 | 512 | );
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.cols
.as_usize(),
61,
"pane 1 column count"
);
assert_eq!(
tab.tiled_panes
.panes
... |
rust_dataset_chunk_515836 | rust_dataset.txt | 515,836 | 512 | 30,
"pane 3 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(3))
.unwrap()
.position_and_size()
.rows
.as_usize(),
16,
"pane 3 row count"
);
assert_eq!(
tab.... |
rust_dataset_chunk_515837 | rust_dataset.txt | 515,837 | 512 | _and_size()
.rows
.as_usize(),
14,
"pane 5 row count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(6))
.unwrap()
.position_and_size()
.x,
91,
"pane 6 x position"
);
... |
rust_dataset_chunk_515838 | rust_dataset.txt | 515,838 | 512 | (size, stacked_resize);
tab.horizontal_split(PaneId::Terminal(2), None, 1, None, None)
.unwrap();
tab.move_focus_up(1).unwrap();
tab.vertical_split(PaneId::Terminal(3), None, 1, None, None)
.unwrap();
tab.vertical_split(PaneId::Terminal(4), None, 1, None, None)
.unwrap();
tab... |
rust_dataset_chunk_515839 | rust_dataset.txt | 515,839 | 512 | 2 x position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.y,
15,
"pane 2 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId... |
rust_dataset_chunk_515840 | rust_dataset.txt | 515,840 | 512 | 0,
"pane 4 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(4))
.unwrap()
.position_and_size()
.cols
.as_usize(),
31,
"pane 4 column count"
);
assert_eq!(
tab.tiled_pa... |
rust_dataset_chunk_515841 | rust_dataset.txt | 515,841 | 512 | _size()
.cols
.as_usize(),
31,
"pane 6 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(6))
.unwrap()
.position_and_size()
.rows
.as_usize(),
15,
"pan... |
rust_dataset_chunk_515842 | rust_dataset.txt | 515,842 | 512 | ::Terminal(8))
.unwrap()
.position_and_size()
.rows
.as_usize(),
16,
"pane 8 row count"
);
}
#[test]
pub fn resize_up_with_panes_below_aligned_left_and_right_with_to_the_left_and_right() {
// ┌─┬─┬───┬─┬─┐ ┌─┬─┬───┬─┬─┐
// │ │... |
rust_dataset_chunk_515843 | rust_dataset.txt | 515,843 | 512 | unwrap();
tab_resize_up(&mut tab, 1);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.x,
0,
"pane 1 x position"
);
assert_eq!(
tab.tiled_panes
.panes
... |
rust_dataset_chunk_515844 | rust_dataset.txt | 515,844 | 512 | _size()
.x,
60,
"pane 3 x position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(3))
.unwrap()
.position_and_size()
.y,
0,
"pane 3 y position"
);
assert_eq!(
tab.tiled_... |
rust_dataset_chunk_515845 | rust_dataset.txt | 515,845 | 512 | .unwrap()
.position_and_size()
.y,
14,
"pane 5 y position"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(5))
.unwrap()
.position_and_size()
.cols
.as_usize(),
31,
... |
rust_dataset_chunk_515846 | rust_dataset.txt | 515,846 | 512 | Id::Terminal(7))
.unwrap()
.position_and_size()
.cols
.as_usize(),
8,
"pane 7 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(7))
.unwrap()
.position_and_size()
... |
rust_dataset_chunk_515847 | rust_dataset.txt | 515,847 | 512 | tab, 1);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(1))
.unwrap()
.position_and_size()
.rows
.as_usize(),
5,
"pane 1 height stayed the same"
);
assert_eq!(
tab.tiled_panes
.pa... |
rust_dataset_chunk_515848 | rust_dataset.txt | 515,848 | 512 | is not the default
let mut tab = create_new_tab(size, stacked_resize);
let new_pane_id_1 = PaneId::Terminal(2);
tab.vertical_split(new_pane_id_1, None, 1, None, None)
.unwrap();
tab_resize_increase(&mut tab, 1);
// should behave like `resize_left_with_pane_to_the_left`
assert_eq!(
... |
rust_dataset_chunk_515849 | rust_dataset.txt | 515,849 | 512 | as_usize(),
67,
"pane 2 column count"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.rows
.as_usize(),
20,
"pane 2 row count"
);
}
#[test]
pub fn... |
rust_dataset_chunk_515850 | rust_dataset.txt | 515,850 | 512 | not the default
let mut tab = create_new_tab(size, stacked_resize);
tab.vertical_split(PaneId::Terminal(2), None, 1, None, None)
.unwrap();
tab.vertical_split(PaneId::Terminal(3), None, 1, None, None)
.unwrap();
tab.move_focus_left(1).unwrap();
tab_resize_increase(&mut tab, 1);
... |
rust_dataset_chunk_515851 | rust_dataset.txt | 515,851 | 512 | y coordinate"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&PaneId::Terminal(2))
.unwrap()
.position_and_size()
.x,
61,
"Pane 3 x coordinate"
);
assert_eq!(
tab.tiled_panes
.panes
.get(&Pan... |
rust_dataset_chunk_515852 | rust_dataset.txt | 515,852 | 512 | (pane.get_content_columns(), pane.get_content_rows());
assert_eq!(content_size, (cols, rows));
tab.new_pane(
PaneId::Terminal(2),
None,
None,
false,
true,
NewPanePlacement::default(),
Some(1),
None,
)
.unwrap();
tab.close_pane(PaneId:... |
rust_dataset_chunk_515853 | rust_dataset.txt | 515,853 | 512 | 1;
// Create first floating pane (will be unpinned)
tab.new_floating_pane(PaneId::Terminal(2), None, None, false, true, None, None)
.unwrap();
// Create second floating pane and pin it
tab.new_floating_pane(PaneId::Terminal(3), None, None, false, true, None, None)
.unwrap();
tab.s... |
rust_dataset_chunk_515854 | rust_dataset.txt | 515,854 | 512 | -index"
);
assert!(
z_index_top.is_some(),
"Pinned floating pane should have z-index"
);
assert!(
z_index_top.unwrap() > z_index_bottom.unwrap(),
"Pinned pane should have higher z-index than regular floating pane (pinned: {}, regular: {})",
z_index_top.unwrap(),
... |
rust_dataset_chunk_515855 | rust_dataset.txt | 515,855 | 512 | _pane_z_index(PaneId::Terminal(999));
assert!(
z_index_nonexistent.is_none(),
"Non-existent pane should return None for z-index"
);
// Query for existing panes
let z_index_2 = tab.floating_panes.get_pane_z_index(PaneId::Terminal(2));
let z_index_3 = tab.floating_panes.get_pane_z_in... |
rust_dataset_chunk_515856 | rust_dataset.txt | 515,856 | 512 | )
.map(|p| p.get_bell_notification())
.unwrap_or(false),
"Pane 2 should have bell notification"
);
}
#[test]
pub fn clearing_last_pane_bell_clears_tab_bell() {
let size = Size {
cols: 121,
rows: 20,
};
let stacked_resize = true;
let mut tab = create_n... |
rust_dataset_chunk_515857 | rust_dataset.txt | 515,857 | 512 | let mut tab = create_new_tab(size, true);
let pane_id = PaneId::Terminal(1);
assert!(tab.has_pane_with_pid(&pane_id));
let _ = tab.scroll_to_top_by_pane_id(pane_id);
}
#[test]
pub fn scroll_to_bottom_by_pane_id() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = crea... |
rust_dataset_chunk_515858 | rust_dataset.txt | 515,858 | 512 | Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let pane_id = PaneId::Terminal(1);
assert!(tab.has_pane_with_pid(&pane_id));
let _ = tab.rename_pane_by_pane_id(pane_id, "new-name".as_bytes().to_vec());
}
#[test]
pub fn undo_rename_pane_by_pane_id() {
le... |
rust_dataset_chunk_515859 | rust_dataset.txt | 515,859 | 512 | let mut tab = create_new_tab(size, true);
let new_pane_id = PaneId::Terminal(2);
tab.horizontal_split(new_pane_id, None, 1, None, None)
.unwrap();
assert_eq!(tab.tiled_panes.panes.len(), 2);
tab.toggle_fullscreen_by_pane_id(new_pane_id);
}
#[test]
pub fn move_pane_by_pane_id_down() {
le... |
rust_dataset_chunk_515860 | rust_dataset.txt | 515,860 | 512 | _id() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let pane_id = PaneId::Terminal(1);
assert!(tab.has_pane_with_pid(&pane_id));
tab.toggle_pane_pinned_by_pane_id(pane_id);
}
#[test]
pub fn scroll_up_nonexistent_pane_id_does_not_panic() {
... |
rust_dataset_chunk_515861 | rust_dataset.txt | 515,861 | 512 | pane_id, "".as_bytes().to_vec());
let pane = tab.get_pane_with_id(pane_id).unwrap();
// Empty name should fall through to the fallback title
assert_ne!(pane.current_title(), "flame");
}
#[test]
pub fn rename_pane_single_char() {
let size = Size {
cols: 121,
rows: 20,
};
let mut ... |
rust_dataset_chunk_515862 | rust_dataset.txt | 515,862 | 512 | = tab.handle_pty_bytes(1, osc_title.to_vec());
let pane = tab.get_pane_with_id(pane_id).unwrap();
assert_eq!(pane.current_title(), "flame");
}
#[test]
pub fn unnamed_pane_shows_osc_title() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let... |
rust_dataset_chunk_515863 | rust_dataset.txt | 515,863 | 512 | _pane_by_pane_id(pane_id);
let pane = tab.get_pane_with_id(pane_id).unwrap();
assert_eq!(pane.current_title(), title_before);
}
#[test]
pub fn undo_rename_on_unnamed_pane_is_noop() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let pane_id ... |
rust_dataset_chunk_515864 | rust_dataset.txt | 515,864 | 512 | (), "flames");
}
#[test]
pub fn interactive_rename_nul_clears_existing_name() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let client_id = 1;
let pane_id = PaneId::Terminal(1);
let _ = tab.rename_pane_by_pane_id(pane_id, "flame".as_bytes(... |
rust_dataset_chunk_515865 | rust_dataset.txt | 515,865 | 512 | 7f], client_id);
let _ = tab.update_active_pane_name(vec![0x7f], client_id);
let _ = tab.update_active_pane_name(vec![0x7f], client_id);
let pane = tab.get_pane_with_id(pane_id).unwrap();
assert_eq!(pane.current_title(), "fl");
}
#[test]
pub fn interactive_rename_backspace_all_then_retype() {
let s... |
rust_dataset_chunk_515866 | rust_dataset.txt | 515,866 | 512 | = tab.undo_active_rename_pane(client_id);
let pane = tab.get_pane_with_id(pane_id).unwrap();
assert_eq!(pane.current_title(), "flame");
}
#[test]
pub fn interactive_rename_esc_on_unnamed_stays_unnamed() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, ... |
rust_dataset_chunk_515867 | rust_dataset.txt | 515,867 | 512 | ::Terminal(1);
let fallback_title = tab.get_pane_with_id(pane_id).unwrap().current_title();
let _ = tab.rename_pane_by_pane_id(pane_id, "spark".as_bytes().to_vec());
tab.undo_rename_pane_by_pane_id(pane_id);
let pane = tab.get_pane_with_id(pane_id).unwrap();
assert_eq!(pane.current_title(), fallback... |
rust_dataset_chunk_515868 | rust_dataset.txt | 515,868 | 512 | pane = tab.get_pane_with_id(pane_id).unwrap();
assert_eq!(pane.current_title(), "spark");
}
#[test]
pub fn cli_rename_active_pane_to_empty_clears_name() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let client_id = 1;
let pane_id = PaneId... |
rust_dataset_chunk_515869 | rust_dataset.txt | 515,869 | 512 | ::new();
while let Ok((msg, _ctx)) = rx.try_recv() {
out.push(msg);
}
out
}
#[test]
pub fn scroll_terminal_up_forwards_sgr_when_pane_tracks_mouse() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let rx = install_pty_writer_captu... |
rust_dataset_chunk_515870 | rust_dataset.txt | 515,870 | 512 | {other:?}"),
}
}
#[test]
pub fn scroll_terminal_up_emits_arrow_up_in_alt_mode_without_mouse() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let rx = install_pty_writer_capture(&mut tab);
tab.handle_pty_bytes(1, b"\x1b[?1049h".to_vec()).un... |
rust_dataset_chunk_515871 | rust_dataset.txt | 515,871 | 512 | writes:?}"
);
}
#[test]
pub fn scroll_terminal_down_walks_scrollback_in_regular_mode_no_pty_write() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, true);
let rx = install_pty_writer_capture(&mut tab);
tab.scroll_terminal_down(1).unwrap();
le... |
rust_dataset_chunk_515872 | rust_dataset.txt | 515,872 | 512 | , Receiver<(PluginInstruction, ErrorContext)>) {
let size = Size {
cols: 121,
rows: 20,
};
let (mut tab, plugin_receiver) = create_new_tab_with_plugin_receiver(size, true);
tab.new_pane(
PaneId::Plugin(plugin_pid),
None,
None,
false,
true,
... |
rust_dataset_chunk_515873 | rust_dataset.txt | 515,873 | 512 | loating_panes();
assert!(!plugin_is_shown(&tab, 1));
tab.show_floating_panes();
assert!(plugin_is_shown(&tab, 1));
}
#[test]
fn showing_the_floating_surface_in_a_hidden_tab_does_not_show_its_plugins() {
let (mut tab, _plugin_receiver) = tab_with_floating_plugin_pane(1);
tab.visible(false).unwrap()... |
rust_dataset_chunk_515874 | rust_dataset.txt | 515,874 | 512 | ),
None,
None,
false,
true,
NewPanePlacement::Floating(None),
Some(1),
None,
)
.unwrap();
assert!(plugin_is_shown(&tab, 1));
assert!(plugin_is_shown(&tab, 2));
tab.toggle_pane_fullscreen(PaneId::Plugin(2));
assert!(plugin_is_shown(&tab, 2... |
rust_dataset_chunk_515875 | rust_dataset.txt | 515,875 | 512 | )>,
_background_jobs: Receiver<(BackgroundJob, ErrorContext)>,
}
fn create_new_tab_with_receivers(
size: Size,
stacked_pane_list: bool,
should_silently_fail: bool,
) -> (Tab, TabReceivers) {
let (mut tab, receivers) =
create_tab_with_receivers_without_layout(size, stacked_pane_list, should_... |
rust_dataset_chunk_515876 | rust_dataset.txt | 515,876 | 512 | ixelImageStore::default())),
Rc::new(RefCell::new(KittyImageStore::default())),
Box::new(FakeInputOutput {}),
senders,
None,
Style::default(),
ModeInfo::default(),
PaneFrameStyle::Full,
true,
Rc::new(RefCell::new(connected_clients)),
Rc::ne... |
rust_dataset_chunk_515877 | rust_dataset.txt | 515,877 | 512 | ![],
})
.collect()
}
fn completion_and_receiver() -> (NotificationEnd, oneshot::Receiver<ActionCompletionResult>) {
let (sender, receiver) = oneshot::channel();
(NotificationEnd::new(sender), receiver)
}
fn assert_reported_as_not_created(
mut receiver: oneshot::Receiver<ActionCompletionRes... |
rust_dataset_chunk_515878 | rust_dataset.txt | 515,878 | 512 | : 121,
rows: 40,
};
let (mut tab, _receivers) = create_new_tab_with_receivers(size, true, true);
new_tiled_pane_in_tab(&mut tab, 2);
assert_eq!(
tab.tiled_panes.focused_pane_id(1),
Some(PaneId::Terminal(2))
);
tab.remove_client(1);
tab.new_pane(
PaneId::Termin... |
rust_dataset_chunk_515879 | rust_dataset.txt | 515,879 | 512 | ane_in_tab(&mut tab, 2);
tab.remove_client(1);
tab.close_pane(PaneId::Terminal(2), false, None);
tab.add_client(2, None).unwrap();
assert_eq!(
tab.tiled_panes.focused_pane_id(2),
Some(PaneId::Terminal(1))
);
}
#[test]
pub fn focus_commands_do_not_crash_when_only_floating_panes_are_s... |
rust_dataset_chunk_515880 | rust_dataset.txt | 515,880 | 512 | inserted"
);
}
#[test]
pub fn failing_to_focus_a_pane_does_not_change_the_last_focused_pane() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, false);
new_tiled_pane_in_tab(&mut tab, 2);
assert_eq!(
tab.tiled_panes.get_last_pane_id(1),
... |
rust_dataset_chunk_515881 | rust_dataset.txt | 515,881 | 512 | 1).unwrap();
let focused = tab.tiled_panes.focused_pane_id(1).unwrap();
tab.tiled_panes.extract_pane(focused);
tab.tiled_panes.focus_last_pane(1);
assert_eq!(tab.tiled_panes.focused_pane_id(1), Some(last));
}
#[test]
pub fn moving_focus_with_a_removed_focused_pane_does_not_crash() {
let mut tab = t... |
rust_dataset_chunk_515882 | rust_dataset.txt | 515,882 | 512 | , ..
} = receivers;
drop(pty_writer);
drop(plugin);
let left_geom_before = tab
.tiled_panes
.get_pane(PaneId::Terminal(1))
.unwrap()
.position_and_size();
tab.move_pane_right(PaneId::Terminal(1));
assert_ne!(
tab.tiled_panes
.get_pane(PaneId::T... |
rust_dataset_chunk_515883 | rust_dataset.txt | 515,883 | 512 | (size, false);
new_tiled_pane_in_tab(&mut tab, 2);
tab.focus_pane_with_id(PaneId::Terminal(1), false, false, 1)
.unwrap();
tab.toggle_active_pane_fullscreen(1);
assert!(tab.tiled_panes.fullscreen_is_active());
assert!(tab.tiled_panes.panes_to_hide_contains(PaneId::Terminal(2)));
tab.supp... |
rust_dataset_chunk_515884 | rust_dataset.txt | 515,884 | 512 | create_new_tab_with_receivers(size, false, true);
let (completion, completion_receiver) = completion_and_receiver();
tab.new_pane(
PaneId::Terminal(2),
None,
None,
false,
true,
NewPanePlacement::Floating(None),
Some(1),
Some(completion),
)
... |
rust_dataset_chunk_515885 | rust_dataset.txt | 515,885 | 512 | {
let size = Size {
cols: 121,
rows: 20,
};
let (mut tab, receivers) = create_new_tab_with_receivers(size, false, true);
tab.vertical_split(PaneId::Plugin(5), None, 1, None, None)
.unwrap();
tab.horizontal_split_of_pane_id(
PaneId::Plugin(6),
None,
No... |
rust_dataset_chunk_515886 | rust_dataset.txt | 515,886 | 512 | 2)]);
assert_reported_as_not_created(completion_receiver, PaneNotCreatedReason::NoRoom);
}
#[test]
pub fn stacked_pane_without_a_target_is_closed() {
let size = Size {
cols: 121,
rows: 20,
};
let (mut tab, receivers) = create_new_tab_with_receivers(size, false, true);
let (completio... |
rust_dataset_chunk_515887 | rust_dataset.txt | 515,887 | 512 | )
.unwrap();
assert!(!tab.has_pane_with_pid(&PaneId::Terminal(3)));
assert_eq!(closed_pane_ids(&receivers), vec![PaneId::Terminal(3)]);
assert_reported_as_not_created(completion_receiver, PaneNotCreatedReason::NoRoom);
}
#[test]
pub fn tiled_panes_hand_back_panes_they_could_not_place() {
let si... |
rust_dataset_chunk_515888 | rust_dataset.txt | 515,888 | 512 | aneId::Terminal(2), detached_terminal_pane(2), None)
.is_some());
assert!(tiny_tab
.tiled_panes
.add_pane_to_stack(&PaneId::Terminal(1), detached_terminal_pane(2))
.is_some());
}
fn new_suppressed_pane_in_tab(tab: &mut Tab, id: u32) {
tab.new_pane(
PaneId::Terminal(id),
... |
rust_dataset_chunk_515889 | rust_dataset.txt | 515,889 | 512 | tab.unsuppress_pane(PaneId::Terminal(2), true);
assert!(tab.has_pane_with_pid(&PaneId::Terminal(2)));
assert!(closed_pane_ids(&receivers).is_empty());
}
#[test]
pub fn stacking_onto_a_missing_pane_keeps_the_panes() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_ne... |
rust_dataset_chunk_515890 | rust_dataset.txt | 515,890 | 512 | unplaced.pid(), PaneId::Terminal(2));
tab.tiled_panes.clear_active_panes();
let unplaced = tab
.tiled_panes
.replace_active_pane(detached_terminal_pane(2), 1)
.err()
.expect("the replacement pane is handed back");
assert_eq!(unplaced.pid(), PaneId::Terminal(2));
assert!(!... |
rust_dataset_chunk_515891 | rust_dataset.txt | 515,891 | 512 | [
PaneId::Terminal(5),
PaneId::Terminal(6),
PaneId::Plugin(7),
PaneId::Terminal(8),
] {
assert!(!tab.has_pane_with_pid(&id));
}
assert_eq!(
closed_pane_ids(&receivers),
vec![
PaneId::Terminal(5),
PaneId::Terminal(6),
... |
rust_dataset_chunk_515892 | rust_dataset.txt | 515,892 | 512 | ();
assert!(tab.has_pane_with_pid(&PaneId::Plugin(6)));
assert!(!tab.has_pane_with_pid(&PaneId::Terminal(1)));
assert_eq!(closed_pane_ids(&receivers), vec![PaneId::Terminal(1)]);
}
#[test]
pub fn existing_pane_that_cannot_replace_its_target_is_handed_back() {
let size = Size {
cols: 121,
... |
rust_dataset_chunk_515893 | rust_dataset.txt | 515,893 | 512 | _whose_replacer_is_gone_places_it_in_the_tab() {
let size = Size {
cols: 121,
rows: 20,
};
let mut tab = create_new_tab(size, false);
new_tiled_pane_in_tab(&mut tab, 2);
tab.replace_pane_with_editor_pane(PaneId::Terminal(5), PaneId::Terminal(2))
.unwrap();
tab.tiled_panes... |
rust_dataset_chunk_515894 | rust_dataset.txt | 515,894 | 512 | loating_panes.panes_contain(&id))
.unwrap_or(false)
}
#[test]
pub fn a_pane_that_fails_to_render_does_not_fail_the_tab_render() {
let mut tab = tab_with_two_floating_panes();
let failing_floating = Box::new(super::test_panes::FailingRenderPane {
inner: detached_terminal_pane(5),
});
tab... |
rust_dataset_chunk_515895 | rust_dataset.txt | 515,895 | 512 | new_floating_pane_in_tab(&mut tab, 3);
let TabReceivers {
pty_writer, plugin, ..
} = receivers;
drop(pty_writer);
drop(plugin);
assert!(tab.resize_pty_all_panes().is_ok());
assert!(tab
.resize_whole_tab(Size {
cols: 100,
rows: 30
})
.is... |
rust_dataset_chunk_515896 | rust_dataset.txt | 515,896 | 512 | !(!tab.floating_panes.pane_is_being_moved_with_mouse());
assert_eq!(
tab.floating_panes.active_pane_id(1),
Some(PaneId::Terminal(2))
);
}
#[test]
pub fn closing_a_floating_pane_being_dragged_stops_the_drag() {
let mut tab = tab_with_two_floating_panes();
tab.floating_panes.set_pane_bein... |
rust_dataset_chunk_515897 | rust_dataset.txt | 515,897 | 512 | !(!floating_focus_is_valid(&tab, 1));
tab.move_focus_left(1).unwrap();
assert!(floating_focus_is_valid(&tab, 1));
assert!(tab
.floating_panes
.get_pane_z_index(PaneId::Terminal(2))
.is_some());
}
#[test]
pub fn moving_focus_without_a_focused_floating_pane_keeps_stacking_order() {
... |
rust_dataset_chunk_515898 | rust_dataset.txt | 515,898 | 512 | anes.active_pane_id(1),
Some(PaneId::Terminal(3)),
"the client that was already here keeps its focus"
);
assert_eq!(
tab.floating_panes.active_pane_id(2),
Some(PaneId::Terminal(3)),
"the joining client shares the focus of the clients already here"
);
}
#[test]
pub fn... |
rust_dataset_chunk_515899 | rust_dataset.txt | 515,899 | 512 | (1));
assert!(tab.floating_panes.move_pane_right(PaneId::Terminal(2)));
}
#[test]
pub fn toggling_fullscreen_with_a_removed_focused_floating_pane_does_nothing() {
let mut tab = tab_with_two_floating_panes();
leave_only_floating_pane(&mut tab, PaneId::Terminal(2));
tab.toggle_active_pane_fullscreen(1);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.