Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2ed84e3
refactor: Simplify transfer_rows_from_viewport_to_lines_above
aidanhs Dec 17, 2023
c1d8b5d
perf: Batch remove rows from the viewport for performance
aidanhs Dec 17, 2023
78fafb1
perf: Optimize Row::drain_until by splitting chars in one step
aidanhs Dec 18, 2023
cca9656
refactor: Simplify `if let` into a `.map`
aidanhs Dec 20, 2023
8ce6ce1
refactor: There are only new saved coordinates when there were old ones
aidanhs Dec 24, 2023
110bf46
refactor: Unify viewport transfer: use common variable names
aidanhs Dec 24, 2023
75143e6
fix: Use same saved cursor logic in height resize as width
aidanhs Dec 25, 2023
37d0dab
fix: Correct saved+real cursor calculations when reflowing long lines
aidanhs Dec 25, 2023
918b642
fix: Don't create canonical lines if cursor ends on EOL after resize
aidanhs Dec 25, 2023
e2c9d6f
fix: for cursor index calculation in lines that are already wrapped
aidanhs Dec 25, 2023
fba2574
chore: test for real/saved cursor position being handled separately
aidanhs Dec 26, 2023
528ccbf
chore: Apply cargo format
aidanhs Dec 27, 2023
c80072d
refactor: Unify viewport transfer: transfer + cursor update together
aidanhs Dec 28, 2023
3ef9638
perf: Reduce size of TerminalCharacter from 72 to 60 bytes
aidanhs Dec 29, 2023
b9d957e
fix(build): Don't unconditionally rebuild zellij-utils
aidanhs Dec 29, 2023
846fda7
refactor: Remove Copy impl on TerminalCharacter
aidanhs Dec 29, 2023
afd2f65
perf: Rc styles to reduce TerminalCharacter from 60 to 24 bytes
aidanhs Dec 29, 2023
7ed840b
perf: Remove RcCharacterStyles::Default, allow enum niche optimisation
aidanhs Dec 29, 2023
d53b0e8
docs: link anchor omission from reset_all is deliberate
aidanhs Dec 29, 2023
a9a5a69
fix: Remove no-op on variable that gets immediately dropped
aidanhs Dec 29, 2023
3b55f63
refactor: Simplify replace_character_at logic
aidanhs Dec 29, 2023
a0731c2
chore: Run xtask format
aidanhs Dec 29, 2023
85195c5
chore(repo): update issue templates
imsnif Dec 28, 2023
28f69af
Bump rust version to 1.75.0 (#3039)
har7an Jan 8, 2024
1621a60
feat(plugins): introduce 'pipes', allowing users to pipe data to and …
imsnif Jan 17, 2024
52d638a
docs(changelog): introduce pipes
imsnif Jan 17, 2024
2bd0bb3
xtask: Disable pusing during publish (#3040)
har7an Jan 20, 2024
58748c1
fix(terminal): some real/saved cursor bugs during resize (#3032)
aidanhs Jan 22, 2024
c8f8673
Merge branch 'main' into aidanhs-aphs-improve-reflow-perf-2
imsnif Jan 22, 2024
0295000
fix integer overflow again (oops)
imsnif Jan 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions xtask/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,38 @@ pub fn build(sh: &Shell, flags: flags::Build) -> anyhow::Result<()> {
std::fs::create_dir_all(&prost_asset_dir).unwrap();

let mut prost = prost_build::Config::new();
let last_generated = prost_asset_dir
.join("generated_plugin_api.rs")
.metadata()
.and_then(|m| m.modified());
let mut needs_regeneration = false;
prost.out_dir(prost_asset_dir);
prost.include_file("generated_plugin_api.rs");
let mut proto_files = vec![];
for entry in std::fs::read_dir(&protobuf_source_dir).unwrap() {
let entry_path = entry.unwrap().path();
if entry_path.is_file() {
if let Some(extension) = entry_path.extension() {
if extension == "proto" {
proto_files.push(entry_path.display().to_string())
}
if !entry_path
.extension()
.map(|e| e == "proto")
.unwrap_or(false)
{
continue;
}
proto_files.push(entry_path.display().to_string());
let modified = entry_path.metadata().and_then(|m| m.modified());
needs_regeneration |= match (&last_generated, modified) {
(Ok(last_generated), Ok(modified)) => modified >= *last_generated,
// Couldn't read some metadata, assume needs update
_ => true,
}
}
}
prost
.compile_protos(&proto_files, &[protobuf_source_dir])
.unwrap();
if needs_regeneration {
prost
.compile_protos(&proto_files, &[protobuf_source_dir])
.unwrap();
}
}

let _pd = sh.push_dir(Path::new(crate_name));
Expand Down
32 changes: 14 additions & 18 deletions zellij-server/src/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::panes::Row;
use crate::{
panes::sixel::SixelImageStore,
panes::terminal_character::{AnsiCode, CharacterStyles},
panes::{LinkHandler, TerminalCharacter, EMPTY_TERMINAL_CHARACTER},
panes::{LinkHandler, TerminalCharacter, DEFAULT_STYLES, EMPTY_TERMINAL_CHARACTER},
ClientId,
};
use std::cell::RefCell;
Expand Down Expand Up @@ -91,14 +91,13 @@ fn serialize_chunks_with_newlines(
let link_handler = link_handler.map(|l_h| l_h.borrow());
for character_chunk in character_chunks {
let chunk_changed_colors = character_chunk.changed_colors();
let mut character_styles =
CharacterStyles::new().enable_styled_underlines(styled_underlines);
let mut character_styles = DEFAULT_STYLES.enable_styled_underlines(styled_underlines);
vte_output.push_str("\n\r");
let mut chunk_width = character_chunk.x;
for t_character in character_chunk.terminal_characters.iter() {
let current_character_styles = adjust_styles_for_possible_selection(
character_chunk.selection_and_colors(),
t_character.styles,
*t_character.styles,
character_chunk.y,
chunk_width,
);
Expand All @@ -110,10 +109,9 @@ fn serialize_chunks_with_newlines(
&mut vte_output,
)
.with_context(err_context)?;
chunk_width += t_character.width;
chunk_width += t_character.width();
vte_output.push(t_character.character);
}
character_styles.clear();
}
Ok(vte_output)
}
Expand All @@ -131,15 +129,14 @@ fn serialize_chunks(
let link_handler = link_handler.map(|l_h| l_h.borrow());
for character_chunk in character_chunks {
let chunk_changed_colors = character_chunk.changed_colors();
let mut character_styles =
CharacterStyles::new().enable_styled_underlines(styled_underlines);
let mut character_styles = DEFAULT_STYLES.enable_styled_underlines(styled_underlines);
vte_goto_instruction(character_chunk.x, character_chunk.y, &mut vte_output)
.with_context(err_context)?;
let mut chunk_width = character_chunk.x;
for t_character in character_chunk.terminal_characters.iter() {
let current_character_styles = adjust_styles_for_possible_selection(
character_chunk.selection_and_colors(),
t_character.styles,
*t_character.styles,
character_chunk.y,
chunk_width,
);
Expand All @@ -151,10 +148,9 @@ fn serialize_chunks(
&mut vte_output,
)
.with_context(err_context)?;
chunk_width += t_character.width;
chunk_width += t_character.width();
vte_output.push(t_character.character);
}
character_styles.clear();
}
if let Some(sixel_image_store) = sixel_image_store {
if let Some(sixel_chunks) = sixel_chunks {
Expand Down Expand Up @@ -215,7 +211,7 @@ fn adjust_middle_segment_for_wide_chars(
let mut pad_left_end_by = 0;
let mut pad_right_start_by = 0;
for (absolute_index, t_character) in terminal_characters.iter().enumerate() {
current_x += t_character.width;
current_x += t_character.width();
if current_x >= middle_start && absolute_middle_start_index.is_none() {
if current_x > middle_start {
pad_left_end_by = current_x - middle_start;
Expand Down Expand Up @@ -802,7 +798,7 @@ impl CharacterChunk {
pub fn width(&self) -> usize {
let mut width = 0;
for t_character in &self.terminal_characters {
width += t_character.width
width += t_character.width()
}
width
}
Expand All @@ -814,14 +810,14 @@ impl CharacterChunk {
break;
}
let next_character = self.terminal_characters.remove(0); // TODO: consider copying self.terminal_characters into a VecDeque to make this process faster?
if drained_part_len + next_character.width <= x {
if drained_part_len + next_character.width() <= x {
drained_part_len += next_character.width();
drained_part.push_back(next_character);
drained_part_len += next_character.width;
} else {
if drained_part_len == x {
self.terminal_characters.insert(0, next_character); // put it back
} else if next_character.width > 1 {
for _ in 1..next_character.width {
} else if next_character.width() > 1 {
for _ in 1..next_character.width() {
self.terminal_characters.insert(0, EMPTY_TERMINAL_CHARACTER);
drained_part.push_back(EMPTY_TERMINAL_CHARACTER);
}
Expand Down Expand Up @@ -963,7 +959,7 @@ impl OutputBuffer {
row: &Row,
viewport_width: usize,
) -> Vec<TerminalCharacter> {
let mut terminal_characters: Vec<TerminalCharacter> = row.columns.iter().copied().collect();
let mut terminal_characters: Vec<TerminalCharacter> = row.columns.iter().cloned().collect();
// pad row
let row_width = row.width();
if row_width < viewport_width {
Expand Down
Loading