Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Author : Chromo-residuum-opec <[email protected]>

inherits = "iceberg-dark"
"ui.menu.selected" = { fg = "background_fg", bg = "menusel_bg" }

[palette]

orange = "#c67439"
pale = "#505695"
purple = "#785ab5"

black = "#dcdfe7"
gray = "#8389a3"
red = "#cd517a"
light-red = "#cc3768"
green = "#668f3d"
light-green = "#598030"
yellow = "#c57339"
light-yellow = "#b6662d"
blue = "#2e539e"
light-blue = "#22478e"
magenta = "#7759b4"
light-magenta = "#6845ad"
cyan = "#3f84a6"
light-cyan = "#327698"
white = "#33374c"
light-gray = "#262a3f"

background_bg = "#e9e9ed"
background_fg = "#33374d"
comment_fg = "#8489a4"
cursorlinenr_bg = "#cccfe0"
linenr_bg = "#dddfe9"
linenr_fg = "#a0a5c0"
matchparen_bg = "#bec0ca"
menusel_bg = "#a9afd1"
sel_bg = "#cacdd8"
statusline_bg = "#cad0de"
statusline_fg = "#757da3"
ref='#n118'>118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
// use helix_tui::{
//     backend::TestBackend,
//     buffer::Buffer,
//     layout::Rect,
//     style::{Color, Style},
//     text::Span,
//     widgets::{Block, Borders},
//     Terminal,
// };

// #[test]
// fn widgets_block_renders() {
//     let backend = TestBackend::new(10, 10);
//     let mut terminal = Terminal::new(backend).unwrap();
//     terminal
//         .draw(|f| {
//             let block = Block::default()
//                 .title(Span::styled("Title", Style::default().fg(Color::LightBlue)))
//                 .borders(Borders::ALL);
//             f.render_widget(
//                 block,
//                 Rect {
//                     x: 0,
//                     y: 0,
//                     width: 8,
//                     height: 8,
//                 },
//             );
//         })
//         .unwrap();
//     let mut expected = Buffer::with_lines(vec![
//         "┌Title─┐  ",
//         "│      │  ",
//         "│      │  ",
//         "│      │  ",
//         "│      │  ",
//         "│      │  ",
//         "│      │  ",
//         "└──────┘  ",
//         "          ",
//         "          ",
//     ]);
//     for x in 1..=5 {
//         expected.get_mut(x, 0).set_fg(Color::LightBlue);
//     }
//     terminal.backend().assert_buffer(&expected);
// }

// #[test]
// fn widgets_block_renders_on_small_areas() {
//     let test_case = |block, area: Rect, expected| {
//         let backend = TestBackend::new(area.width, area.height);
//         let mut terminal = Terminal::new(backend).unwrap();
//         terminal
//             .draw(|f| {
//                 f.render_widget(block, area);
//             })
//             .unwrap();
//         terminal.backend().assert_buffer(&expected);
//     };

//     let one_cell_test_cases = [
//         (Borders::NONE, "T"),
//         (Borders::LEFT, "│"),
//         (Borders::TOP, "T"),
//         (Borders::RIGHT, "│"),
//         (Borders::BOTTOM, "T"),
//         (Borders::ALL, "┌"),
//     ];
//     for (borders, symbol) in one_cell_test_cases.iter().cloned() {
//         test_case(
//             Block::default().title("Test").borders(borders),
//             Rect {
//                 x: 0,
//                 y: 0,
//                 width: 0,
//                 height: 0,
//             },
//             Buffer::empty(Rect {
//                 x: 0,
//                 y: 0,
//                 width: 0,
//                 height: 0,
//             }),
//         );
//         test_case(
//             Block::default().title("Test").borders(borders),
//             Rect {
//                 x: 0,
//                 y: 0,
//                 width: 1,
//                 height: 0,
//             },
//             Buffer::empty(Rect {
//                 x: 0,
//                 y: 0,
//                 width: 1,
//                 height: 0,
//             }),
//         );
//         test_case(
//             Block::default().title("Test").borders(borders),
//             Rect {
//                 x: 0,
//                 y: 0,
//                 width: 0,
//                 height: 1,
//             },
//             Buffer::empty(Rect {
//                 x: 0,
//                 y: 0,
//                 width: 0,
//                 height: 1,
//             }),
//         );
//         test_case(
//             Block::default().title("Test").borders(borders),
//             Rect {
//                 x: 0,
//                 y: 0,
//                 width: 1,
//                 height: 1,
//             },
//             Buffer::with_lines(vec![symbol]),
//         );
//     }
//     test_case(
//         Block::default().title("Test").borders(Borders::LEFT),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 4,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["│Tes"]),
//     );
//     test_case(
//         Block::default().title("Test").borders(Borders::RIGHT),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 4,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["Tes│"]),
//     );
//     test_case(
//         Block::default().title("Test").borders(Borders::RIGHT),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 4,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["Tes│"]),
//     );
//     test_case(
//         Block::default()
//             .title("Test")
//             .borders(Borders::LEFT | Borders::RIGHT),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 4,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["│Te│"]),
//     );
//     test_case(
//         Block::default().title("Test").borders(Borders::TOP),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 4,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["Test"]),
//     );
//     test_case(
//         Block::default().title("Test").borders(Borders::TOP),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 5,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["Test─"]),
//     );
//     test_case(
//         Block::default()
//             .title("Test")
//             .borders(Borders::LEFT | Borders::TOP),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 5,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["┌Test"]),
//     );
//     test_case(
//         Block::default()
//             .title("Test")
//             .borders(Borders::LEFT | Borders::TOP),
//         Rect {
//             x: 0,
//             y: 0,
//             width: 6,
//             height: 1,
//         },
//         Buffer::with_lines(vec!["┌Test─"]),
//     );
// }