text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>me)); assertThat(e.getType(), is(equalTo(ApiException.Type.ILLEGAL_PARAMETER))); } @Test void shouldReturnBooleanValueWhenGettingBoolean() throws Exception { // Given String name = "ParamBoolean"; boolean value = true; JSONObject params = new JSONObject...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2014 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may no<|fim_suffix|> // Then assertThat(i...
fim
zaproxy/zaproxy
java
<|fim_suffix|>(TEST_ARRAY); // when byteBuilder.append(2); byte[] toByteArray = byteBuilder.toByteArray(); // then assertThat(toByteArray, is(new byte[] {1, 2, 3, 0, 0, 0, 2})); } @Test void shouldAppendLongValue() { // given byteBuilder = new ByteBui...
fim
zaproxy/zaproxy
java
<|fim_suffix|>r}. */ class ContentMatcherUnitTest { @Test void shouldCreateContentMatcherFromFile() throws Exception { // Given String file = "content-matcher-patterns.xml"; // When ContentMatcher matcher = ContentMatcher.getInstance(file); // Then assertThat(pat...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2025 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2025 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2015 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2018 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2015 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2018 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2019 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|> try { new SimpleDateFormat(rb.getString(keyPattern)); } catch (Exception e) { errors.add(buildMessage(fileName, pattern, keyPattern, e)); } } private static String buildMessage( String fileName, String pattern, String keyPattern, Exception exc...
fim
zaproxy/zaproxy
java
<|fim_suffix|>fic language governing permissions and * limitations under the License. */ package org.zaproxy.zap.utils; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import org.junit.jupiter.api.Test; class XMLStringUtilUnitTest { @Test void shouldNotEscapeXm...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2025 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2018 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>bstractMultipleOptionsBaseTableModel<Object> tableModel = new MultipleOptionsBaseTableModelImpl(elements); TestTableModelListener listener = createTestTableModelListener(); tableModel.addTableModelListener(listener); // When tableModel.removeElement(1); ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>ypeInfo typeInfo = null; // When / Then assertThrows(NullPointerException.class, () -> HrefTypeInfo.removeType(typeInfo)); } @Test void shouldNotOverrideNoType() { // Given int type = HrefTypeInfo.NO_TYPE.getType(); HrefTypeInfo typeInfo = new HrefTypeI...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2015 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|> HEIGHT, WEIGHT_X, WEIGHT_Y, FILL, ANCHOR, INSETS); // then assertThat(constraints.gridx, is(X)); assertThat(constraints.gridy, is(Y)); assertThat(constraints.gridwidth, is(WIDTH)); assertThat(constraints.gridheight, is(HEIGHT)); assertThat(constraints.weigh...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2016 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2016 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>omponent.getComponentCasted(); assertThat(foundButton.getText(), is(btnText)); } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2017 The ZAP Development Team * * Licensed under...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2021 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2016 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>} to run or not GUI tests. * * <p>Tests are not enabled if the environment is headless. * * @see GraphicsEnvironment#isHeadless() */ public class GuiCondition implements ExecutionCondition { private static final ConditionEvaluationResult ENABLED = ConditionEvaluationResult.enabled("E...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2026 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_suffix|>ge(Box::new(go_to_page)) } pub fn new_open_link(destination: String, executable: Rc<RefCell<String>>) -> Self { ClickAction::OpenLink(destination, executable) } pub fn new_launch_plugin(plugin_url: String) -> Self { ClickAction::LaunchPlugin(plugin_url) } } <|fim_prefix...
fim
zellij-org/zellij
rust
<|fim_suffix|>ing_sub(UI_COLUMNS) / 2; let desired_y_coords = self.tab_rows.saturating_sub(UI_ROWS) / 2; change_floating_panes_coordinates(vec![( PaneId::Plugin(self.own_plugin_id.unwrap()), FloatingPaneCoordinates::new( Som...
fim
zellij-org/zellij
rust
<|fim_suffix|> }); } pub fn set_active_bulletin(&mut self, new_index: usize) { self.items.get_mut(new_index).map(|i| { i.is_active = true; }); } pub fn set_last_active_bulletin(&mut self) { self.items.last_mut().map(|i| { i.is_active = true; }); ...
fim
zellij-org/zellij
rust
<|fim_suffix|>tomRender::Text(Text::new("https://zellij.dev/tutorials/colliding-keybindings"))) .with_hover(TextOrCustomRender::CustomRender(Box::new(colliding_keybindings_link_selected), Box::new(colliding_keybindings_link_selected_len))) .with_left_click_action(ClickAct...
fim
zellij-org/zellij
rust
use zellij_tile::prelude::actions::Action; use zellij_tile::prelude::*; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ActionType { MoveFocus, MovePaneWithDirection, MovePaneWithoutDirection, ResizeIncrease, ResizeDecrease, ResizeAny, Search, NewPaneWithDirection, NewPaneWith...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::LinePart; use zellij_tile::prelude::*; pub fn text_copied_hint(copy_destination: CopyDestination) -> LinePart { let hint = match copy_destination { CopyDestination::Command => "Text piped to external command", <|fim_suffix|>lor_range(2, ..).opaque()), len: hint.len(), ...
fim
zellij-org/zellij
rust
<|fim_suffix|> |action: &Action| action.launches_plugin("plugin-manager"), |action: &Action| action.launches_plugin("configuration"), |action: &Action| action.launches_plugin("zellij:about"), ]; Self::find_predetermined_actions(mode_info, mode, o...
fim
zellij-org/zellij
rust
use ansi_term::ANSIStrings; use unicode_width::UnicodeWidthStr; use crate::{LinePart, TabRenderData, ARROW_SEPARATOR}; use zellij_tile::prelude::*; use zellij_tile_utils::style; pub fn tab_line( mode_info: &ModeInfo, tab_data: TabRenderData, cols: usize, toggle_tooltip_key: Option<String>, tooltip...
fim
zellij-org/zellij
rust
<|fim_prefix|>mod action_types; mod clipboard_utils; mod keybind_utils; mod line; mod tab; mod tooltip; use std::cmp::{max, min}; use std::collections::BTreeMap; use std::convert::TryInto; use tab::get_tab_to_focus; use zellij_tile::prelude::*; use crate::clipboard_utils::{system_clipboard_error, text_copied_hint}; ...
fim
zellij-org/zellij
rust
<|fim_suffix|> palette.ribbon_unselected.emphasis_1 } else { palette.ribbon_unselected.background }; let background_color = if tab.active { palette.ribbon_selected.background } else if is_alternate_tab { alternate_tab_color } else { palette.ribbon_unselected.back...
fim
zellij-org/zellij
rust
<|fim_suffix|>; 2]); let mut row_count = 1; // Start with header row if actions_vec.is_empty() { let tooltip_text = match self.mode_info.mode { InputMode::EnterSearch => "Entering search term...".to_owned(), InputMode::RenameTab => "Renaming tab...".to_owned(...
fim
zellij-org/zellij
rust
<|fim_prefix|>mod presets; mod presets_screen; mod rebind_leaders_screen; mod ui_components; use zellij_tile::prelude::*; use presets_screen::PresetsScreen; use rebind_leaders_screen::RebindLeadersScreen; use ui_compone<|fim_suffix|> }, Event::Key(key) => { if self.notification.is_some()...
fim
zellij-org/zellij
rust
pub fn unlock_first_keybinds(primary_modifier: String, secondary_modifier: String) -> String { format!( r#" default_mode "locked" keybinds clear-defaults=true {{ normal {{ }} locked {{ bind "{primary_modifier} g" {{ SwitchToMode "Normal"; }} }} resize {{ bind "r" {{ Switc...
fim
zellij-org/zellij
rust
<|fim_suffix|>ode is left here in case someone feels strongly about implementing this on // their own, and because at the time of writing I'm a little ambiguous about this // decision. At some point it should be refactored away // self.rebind_leaders_screen = Some( ...
fim
zellij-org/zellij
rust
<|fim_suffix|> - common actions" } else { "" }; print_text_with_coordinates( Text::new(leader_keys_text).color_range(2, ..), base_x, base_y, None, None, ); print_text_with_coordinates( Text::new(e...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::{Screen, WIDTH_BREAKPOINTS}; use zellij_tile::prelude::*; pub fn top_tab_menu(cols: usize, current_screen: &Screen, colors: &Styling) { let background = colors.text_unselected.background; let bg_color = match background { PaletteColor::Rgb((r, g, b)) => format!("\u{1b}[48;2;{};...
fim
zellij-org/zellij
rust
<|fim_suffix|> path: std::path::PathBuf::from("/path/to/my/file.rs"), line_number: Some(42), ..Default::default() }, None, BTreeMap::new(), ); }, ...
fim
zellij-org/zellij
rust
<|fim_suffix|> + 1, 2, truncated ); current_row += 1; } } } } <|fim_prefix|>use crate::screens::{KeyResponse, Screen}; use crate::ui::{truncate_line_with_ansi, wrap_text_to_width, ErrorMessage, MultiLineErrorMessage}; use ze...
fim
zellij-org/zellij
rust
<|fim_prefix|>mod errors; mod screens; mod text_input; mod ui; use errors::format_kdl_error; use screens::{KeyResponse, OptimisticUpdate, Screen}; use std::collections::BTreeMap; use ui::{get_last_modified_string, get_layout_display_info}; use zellij_tile::prelude::*; #[derive(Clone)] pub enum DisplayLayout { Val...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::{KeyResponse, LayoutListScreen, OptimisticUpdate, Screen}; use crate::errors::{format_kdl_error, ErrorScreen}; use crate::text_input::{InputAction, TextInput}; use crate::ui::{truncate_with_ellipsis_start, LayoutDetail, Title}; use crate::{DisplayLayout, LayoutInfo}; use zellij_tile::prelude::*...
fim
zellij-org/zellij
rust
<|fim_suffix|> self.update_filter(display_layouts); } self.apply_only_to_active_tab = self.should_default_to_current_tab(display_layouts); } fn is_searching(&self) -> bool { (self.search_state.is_active() && !self.search_state.get_search_results().is_empty()) || self.searc...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::text_input::TextInput; use crate::DisplayLayout; use fuzzy_matcher::skim::SkimMatcherV2; use fuzzy_matcher::FuzzyMatcher; use zellij_tile::prelude::*; #[derive(Clone)] pub struct SearchResult { pub layout: DisplayLayout, pub original_index: usize, pub score: i64, pub matched_in...
fim
zellij-org/zellij
rust
<|fim_suffix|>should_render: true, new_screen: None, optimistic_update: None, } } pub fn new_screen(screen: Screen) -> Self { KeyResponse { should_render: true, new_screen: Some(screen), optimistic_update: None, } } pu...
fim
zellij-org/zellij
rust
use super::{ErrorScreen, KeyResponse, LayoutListScreen, OptimisticUpdate, Screen}; use crate::text_input::{InputAction, TextInput}; use crate::ui::{truncate_with_ellipsis_start, LayoutDetail}; use crate::DisplayLayout; use zellij_tile::prelude::*; #[derive(Clone)] pub struct NewLayoutFromCurrentSessionScreen { pub...
fim
zellij-org/zellij
rust
<|fim_suffix|>_layout_index), )) .with_optimistic(optimistic), Err(error_msg) => KeyResponse::new_screen(self.create_error_screen(&error_msg)), } } fn create_error_screen(&self, message: &str) -> Screen { show_cursor(None); Screen::Error(ErrorScreen {...
fim
zellij-org/zellij
rust
<|fim_suffix|> // Backspace input.backspace(); assert_eq!(input.get_text(), "a"); // Type "c" input.insert_char('c'); assert_eq!(input.get_text(), "ac"); // Undo should remove just "c" input.undo(); assert_eq!(input.get_text(), "a"); // Un...
fim
zellij-org/zellij
rust
<|fim_suffix|> collect_pane_info(&self, metadata: &LayoutMetadata) -> (Vec<String>, usize) { let mut named_panes = Vec::new(); let mut terminal_count = 0; for tab in &metadata.tabs { for pane in &tab.panes { // Skip builtin plugin panes if pane.is_bui...
fim
zellij-org/zellij
rust
<|fim_suffix|>out_text.chars().count()); // Lines 4-5: Advanced options (only if show_more_options) if self.show_more_options { let (retain_text, _) = self.get_retain_text_and_highlight(max_cols); width = width.max(retain_text.chars().count()); let (target_text, _) ...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub mod layout_detail_view; pub mod layout_table; pub mod multi_line_error_<|fim_suffix|>; <|fim_middle|>message; pub mod text_utils; pub use layout_detail_view::LayoutDetail; pub use layout_table::{Controls, ErrorMessage, LayoutsTable, Title}; pub use multi_line_error_message::MultiLineErrorMessage; pub...
fim
zellij-org/zellij
rust
<|fim_prefix|>use zellij_tile::prelude::*; pub struct MultiLineErrorMessage { message: Vec<String>, } impl MultiLineErrorMessage { pub fn new(message: Vec<String>) -> Self { Self { message } } pub fn render(&self, x: usize, y: usize, max_rows: usize) { let title = Text::new("Error").e...
fim
zellij-org/zellij
rust
<|fim_suffix|>, UNIX_EPOCH}; let now = SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap() .as_secs() as i64; let diff = now - timestamp; if diff < 60 { "now".to_string() } else if diff < 3600 { format!("{}m ago", diff / 60) } else if diff < 86400 { ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::collections::{BTreeMap, HashMap, HashSet}; use std::path::{Path, PathBuf}; use zellij_tile::prelude::*; const FILE_PATH_REGEX: &str = r#"(?:^|\s)((?:(?:\./|\.\./|/)[A-Za-z0-9_./\-+@%,#=~!\$\{\}\[\]]+|~/[A-Za-z0-9_./\-+@%,#=~!\$\{\}\[\]]+|\$\{?[A-Za-z_][A-Za-z0-9_]*\}?/[A-Za-z0-9_./\-+@%,#=~!\$\{...
fim
zellij-org/zellij
rust
<|fim_prefix|>use unicode_width::UnicodeWidthStr; pub(crate) const RESET: &str = "\x1b[0m"; pub(crate) fn move_to(row: usize, col: usize) -> String { format!("\x1b[{};{}H", row + 1, col + 1) } pub(crate) fn format_time_ago(then_unix_secs: Option<u64>, now_unix_secs: u64) -> String { let Some(then) = then_uni...
fim
zellij-org/zellij
rust
<|fim_suffix|> center: Some(center), } } } #[derive(Debug, Clone, Copy)] pub struct ViewportRegion { pub row_start: usize, pub row_end: usize, pub cols: usize, pub skip: usize, pub h_offset: usize, } pub fn slop_key(r: &ClickRegion) -> (usize, usize) { match r.center { ...
fim
zellij-org/zellij
rust
<|fim_suffix|> mod top_bar; <|fim_prefix|>pub mod modifier_<|fim_middle|>bar; pub<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_suffix|> let p2 = w - nat; assert_eq!(p2 % 2, 0, "cols={} cell padding {} not even", cols, p2); p2 / 2 }) .collect(); let first = pads[0]; for (i, &p) in pads.iter().enumerate() { assert_eq!( ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::ops::Range; use unicode_width::UnicodeWidthStr; use zellij_tile::prelude::*; use crate::ansi::pad_or_truncate; use crate::click::{ClickAction, ClickRegion}; use crate::frame::Frame; use crate::screens::ActiveScreen; use crate::workspace::Workspace; const PREFIX: &str = "Zellij "; const HAMBURGE...
fim
zellij-org/zellij
rust
<|fim_prefix|>use zellij_tile::prelude::*; use crate::frame::{chrome_offsets, Frame}; use crate::workspace::{pane_id_of, Workspace}; #[derive(Default)] pub struct Fit { pub active: bool, pub tab_id: Option<usize>, pub last_sent_size: Option<Size>, } impl Fit { pub fn toggle(&mut self, ws: &Workspace,...
fim
zellij-org/zellij
rust
<|fim_suffix|>_eq!(f.click_to_action(5, 13), Some(kb(2))); } #[test] fn slop_resolves_by_nearest_center() { let mut f = Frame::default(); f.click_regions.push(ClickRegion::tight(5, 10, 13, kb(1))); for r in 4..=6 { f.click_regions .push(ClickRegion::slop(...
fim
zellij-org/zellij
rust
<|fim_suffix|>impl Input { pub fn merge_held_modifiers(&self, key: &KeyWithModifier) -> KeyWithModifier { let mut merged = key.clone(); if self.ctrl_held { merged.key_modifiers.insert(KeyModifier::Ctrl); } if self.alt_held { merged.key_modifiers.insert(KeyModi...
fim
zellij-org/zellij
rust
<|fim_prefix|>use zellij_tile::prelude::*; pub fn serial<|fim_suffix|>fiers.contains(&KeyModifier::Ctrl); let alt = key.key_modifiers.contains(&KeyModifier::Alt); let shift = key.key_modifiers.contains(&KeyModifier::Shift); match key.bare_key { BareKey::Char(c) => serialize_char(c, ctrl, alt, shif...
fim
zellij-org/zellij
rust
mod ansi; mod click; mod components; mod fit; mod frame; mod input; mod keys; mod mouse; mod navigation; mod pane_sync; mod render; mod screens; mod state; mod workspace; use std::collections::BTreeMap; use zellij_tile::prelude::*; use crate::components::modifier_bar::{CellId, TapOutcome}; use crate::screens::ActiveS...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::collections::BTreeMap; use zellij_tile::prelude::*; use crate::click; use crate::screens::ActiveScreen; use crate::state::State; use crate::workspace::pane_id_of; pub(crate) fn scroll_or_pan(state: &mut State, lines: usize, up: bool) -> bool { if state.active != ActiveScreen::Viewport { ...
fim
zellij-org/zellij
rust
<|fim_suffix|>use_cache(true)) } } <|fim_prefix|>use fuzzy_matcher::skim::SkimMatcherV2; #[derive(Default)] pub struct Navigation { pub selector_scroll_offset: usize, pub fuzzy_matcher: Option<S<|fim_middle|>kimMatcherV2>, } impl Navigation { pub fn matcher(&mut self) -> &mut SkimMatcherV2 { s...
fim
zellij-org/zellij
rust
<|fim_prefix|>use zellij_tile::prelude::*; use crate::filter_sessions_for_client; use crate::screens::ActiveScreen; use crate::state::State; use crate::workspace::pane_id_of; const EMPTY_WELCOME_LIST_GRACE_SECS: f64 = 0.4; pub fn refresh_pane_manifest(state: &mut State, manifest: PaneManifest) { state.workspace....
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::ansi::{move_to, RESET}; use crate::components::{modifier_bar, top_bar}; use crate::frame::chrome_offsets; use crate::screens::ActiveScreen; use crate::state::State; pub fn render(state: &mut State, rows: usize, cols: usize) { reset_frame(state, rows, cols); if rows < 4 || cols < 8 { ...
fim
zellij-org/zellij
rust
use unicode_width::UnicodeWidthStr; use zellij_tile::prelude::*; use crate::click::{ClickAction, ClickRegion}; use crate::fit::Fit; use crate::frame::Frame; use crate::screens::ActiveScreen; const H_PAD: usize = 1; const SEPARATOR_CHAR: char = '\u{2500}'; const ENTRIES: [HamburgerEntry; 5] = [ HamburgerEntry::It...
fim
zellij-org/zellij
rust
pub mod menu; pub mod new_session; pub mod panes; pub mod sessions; pub mod viewport; pub use menu::MenuScreen; pub use new_session::NewSessionPromptScreen; pub use panes::PanesScreen; pub use sessions::SessionsScreen; pub use viewport::ViewportScreen; #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub enum Ac...
fim
zellij-org/zellij
rust
<|fim_prefix|>use <|fim_suffix|>t); draw_title(&layout); draw_input(&input, &layout); draw_buttons(frame, &layout); } fn visible_input_row(&mut self, cols: usize) -> String { const CURSOR_CELL: usize = 1; let max_input_total_w = cols.saturating_sub(2 * H_PAD); le...
fim
zellij-org/zellij
rust
<|fim_suffix|> } )); assert!(matches!(actions[2], ClickAction::NewTab)); assert!(matches!( actions[3], ClickAction::NewPaneInTab { tab_position: 0 } )); } #[test] fn panes_menu_two_tabs_emits_single_footer_new_pane() { let mut state = state_w...
fim
zellij-org/zellij
rust
<|fim_prefix|>use fuzzy_matcher::FuzzyMatcher; use unicode_width::UnicodeWidthStr; use zellij_tile::prelude::*; use crate::click::{ClickAction, ClickRegion}; use crate::frame::Frame; use crate::navigation::Navigation; use crate::screens::ActiveScreen; const CARD_BULLET: &str = "- "; const CARD_INDENT_W: usize = 2; co...
fim
zellij-org/zellij
rust
<|fim_prefix|>use zellij_tile::prelude::*; use crate::ansi::{move_to, slice_ansi_visible, visible_width, RESET}; use crate::click::ViewportRegion; use crate::frame::Frame; use crate::input::Input; use crate::keys; use crate::workspace::{pane_id_of, Workspace}; const DISABLE_AUTOWRAP: &str = "\x1b[?7l"; const ENABLE_A...
fim
zellij-org/zellij
rust
use crate::fit::Fit; use crate::frame::Frame; use crate::input::Input; use crate::navigation::Navigation; use crate::screens::{ ActiveScreen, MenuScreen, NewSessionPromptScreen, PanesScreen, SessionsScreen, ViewportScreen, }; use crate::workspace::Workspace; #[derive(Default)] pub struct State { pub workspace:...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::collections::HashMap; use zellij_tile::prelude::*; const WELCOME_SCREEN_PLUGIN_ALIAS: &str = "welcome-screen"; #[derive(Default)] pub struct Workspace { pub own_plugin_pane_id: Option<PaneId>, pub tabs: Vec<TabInfo>, pub panes_by_tab_position: HashMap<usize, Vec<PaneInfo>>, pub ...
fim
zellij-org/zellij
rust
<|fim_suffix|>collect(); } common.into_iter().collect() } fn render_follow_focus_ribbon( group_mark_key: &str, x_position: usize, base_y: usize, mode_info: &ModeInfo, ) { let follow_text = format!("<{}> Follow Focus", group_mark_key); let key_highlight = format!("{}", group_mark_key); ...
fim
zellij-org/zellij
rust
<|fim_suffix|>ring.chars().count() + 1..); if let Some(indices) = indices { item = item.color_indices(3, indices); } item } fn render_plugin_line( &self, location_string: String, indices: Option<Vec<usize>>, ) -> NestedListItem { let mut it...
fim
zellij-org/zellij
rust
mod new_session_info; mod resurrectable_sessions; mod session_list; mod single_screen; mod ui; use std::collections::BTreeMap; use uuid::Uuid; use zellij_tile::prelude::*; use new_session_info::NewSessionInfo; use single_screen::{DeleteTarget, SingleScreenMode, SingleScreenState, UnifiedSearchResult}; use ui::{ co...
fim
zellij-org/zellij
rust
<|fim_prefix|>use fuzzy_matcher::skim::SkimMatcherV2; use fuzzy_matcher::FuzzyMatcher; use std::path::PathBuf; use zellij_tile::prelude::*; #[derive(Default)] pub struct NewSessionInfo { name: String, layout_list: LayoutList, entering_new_session_info: EnteringState, pub is_welcome_screen: bool, pu...
fim
zellij-org/zellij
rust
<|fim_prefix|>use fuzzy_matcher::skim::SkimMatcherV2; use fuzzy_matcher::FuzzyMatcher; use humantime::format_duration; use std::time::Duration; use zellij_tile::shim::*; #[derive(Debug, Default)] pub struct ResurrectableSessions { pub all_resurrectable_sessions: Vec<(String, Duration)>, pub selected_index: O...
fim
zellij-org/zellij
rust
<|fim_prefix|>use fuzzy_matcher::skim::SkimMatcherV2; use fuzzy_matcher::FuzzyMatcher; use crate::ui::{ components::{Colors, LineToRender, ListItem}, SessionUiInfo, }; #[derive(Debug, Default)] pub struct SessionList { pub session_ui_infos: Vec<SessionUiInfo>, pub forbidden_sessions: Vec<SessionUiInfo...
fim
zellij-org/zellij
rust
<|fim_prefix|>use fuzzy_matcher::skim::SkimMatcherV2; use fuzzy_matcher::FuzzyMatcher; use std::path::PathBuf; use std::time::Duration; use crate::new_session_info::LayoutList; use crate::ui::components::UnifiedResultsRenderCache; use crate::ui::SessionUiInfo; #[derive(Debug, Clone, PartialEq)] pub enum SingleScreenM...
fim
zellij-org/zellij
rust
<|fim_suffix|> ch_width > max_width { break; } result.push(ch); current_width += ch_width; } result } #[derive(Debug, Default)] pub struct TruncatableUiSpan { text: String, style: SpanStyle, } impl TruncatableUiSpan { pub fn new(text: String, style: SpanStyle) -...
fim
zellij-org/zellij
rust
<|fim_suffix|> let mut result_lines = result.render(max_cols); if Some(i) == self.selected_search_index { let mut render_arrows = true; for line_to_render in result_lines.iter_mut() { line_to_render.make_selected_as_search(render_a...
fim
zellij-org/zellij
rust
<|fim_suffix|>92;118my 9@@F"  $@@@$ 4@@@@@@~@[38;2;126;159;19...
fim
zellij-org/zellij
rust
mod main_screen; mod token_management_screen; mod token_screen; mod ui_components; use std::net::IpAddr; use zellij_tile::prelude::*; use std::collections::{BTreeMap, HashMap}; use main_screen::MainScreen; use token_management_screen::TokenManagementScreen; use token_screen::TokenScreen; static WEB_SERVER_QUERY_DUR...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::CoordinatesInLine; use crate::ui_components::{ hovering_on_line, render_text_with_underline, CurrentSessionSection, Usage, WebServerStatusSection, }; use zellij_tile::prelude::*; use std::collections::HashMap; use url::Url; pub struct MainScreenState { pub currently_hovering_over_...
fim
zellij-org/zellij
rust
use zellij_tile::prelude::*; #[derive(Debug)] struct ScreenContent { title: (String, Text), items: Vec<Vec<Text>>, help: (String, Text), status_message: Option<(String, Text)>, max_width: usize, new_token_line: Option<(String, Text)>, } #[derive(Debug)] struct Layout { base_x: usize, b...
fim
zellij-org/zellij
rust
<|fim_suffix|>-> Text { Text::new(token_text).color_range(2, ..token_label.chars().count()) } fn calculate_max_width(&self, elements: &ScreenElements) -> usize { let token_width = elements.token_text.chars().count(); let explanation_widths = elements .explanation_texts ...
fim
zellij-org/zellij
rust
<|fim_suffix|>ount(), COLOR_INDEX_0) .highlight_substring(WEB_SERVER_RUNNING.trim(), COLOR_HIGHLIGHT) .highlight_substring("<Ctrl c>", COLOR_HIGHLIGHT) .build() } fn create_incompatible_version_line(&self, different_version: &str) -> (Text, usize) { let value = forma...
fim
zellij-org/zellij
rust
<|fim_prefix|>use ansi_term::{unstyled_len, ANSIStrings}; use zellij_tile::prelude::actions::Action; use zellij_tile::prelude::*; use crate::color_elements; use crate::{ action_key, action_key_group, get_common_modifiers, style_key_with_modifier, TO_NORMAL, }; use crate::{ColoredElements, LinePart}; #[derive(Debu...
fim
zellij-org/zellij
rust