Skip to content

Commit 279a7da

Browse files
Merge branch 'zellij-org:main' into focus-last-pane
2 parents 2efba34 + 2580564 commit 279a7da

File tree

5 files changed

+1384
-2
lines changed

5 files changed

+1384
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1111
* performance: consolidate renders (https://github.com/zellij-org/zellij/pull/4245)
1212
* feat: add plugin API to replace a pane with another existing pane (https://github.com/zellij-org/zellij/pull/4246)
1313
* feat: add "stack" keybinding and CLI action to add a stacked pane to the current pane (https://github.com/zellij-org/zellij/pull/4255)
14+
* fix: support multiline hyperlinks (https://github.com/zellij-org/zellij/pull/4264)
1415

1516
## [0.42.2] - 2025-04-15
1617
* refactor(terminal): track scroll_region as tuple rather than Option (https://github.com/zellij-org/zellij/pull/4082)

zellij-server/src/panes/grid.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use zellij_utils::{consts::VERSION, shared::version_number};
3131

3232
use crate::output::{CharacterChunk, OutputBuffer, SixelImageChunk};
3333
use crate::panes::alacritty_functions::{parse_number, xparse_color};
34+
use crate::panes::hyperlink_tracker::HyperlinkTracker;
3435
use crate::panes::link_handler::LinkHandler;
3536
use crate::panes::search::SearchResult;
3637
use crate::panes::selection::Selection;
@@ -363,6 +364,7 @@ pub struct Grid {
363364
explicitly_disable_kitty_keyboard_protocol: bool, // has kitty keyboard support been explicitly
364365
// disabled by user config?
365366
click: Click,
367+
hyperlink_tracker: HyperlinkTracker,
366368
}
367369

368370
const CLICK_TIME_THRESHOLD: u128 = 400; // Doherty Threshold
@@ -550,6 +552,7 @@ impl Grid {
550552
supports_kitty_keyboard_protocol: false,
551553
explicitly_disable_kitty_keyboard_protocol,
552554
click: Click::default(),
555+
hyperlink_tracker: HyperlinkTracker::new(),
553556
}
554557
}
555558
pub fn render_full_viewport(&mut self) {
@@ -1294,6 +1297,13 @@ impl Grid {
12941297
}
12951298
pub fn add_canonical_line(&mut self) {
12961299
let (scroll_region_top, scroll_region_bottom) = self.scroll_region;
1300+
self.hyperlink_tracker.update(
1301+
'\n',
1302+
&self.cursor,
1303+
&mut self.viewport,
1304+
&mut self.lines_above,
1305+
&mut self.link_handler.borrow_mut(),
1306+
);
12971307
if self.cursor.y == scroll_region_bottom {
12981308
// end of scroll region
12991309
// when we have a scroll region set and we're at its bottom
@@ -1348,6 +1358,13 @@ impl Grid {
13481358
terminal_character: TerminalCharacter,
13491359
should_insert_character: bool,
13501360
) {
1361+
self.hyperlink_tracker.update(
1362+
terminal_character.character,
1363+
&self.cursor,
1364+
&mut self.viewport,
1365+
&mut self.lines_above,
1366+
&mut self.link_handler.borrow_mut(),
1367+
);
13511368
// this function assumes the current line has enough room for terminal_character (that its
13521369
// width has been checked beforehand)
13531370
match self.viewport.get_mut(self.cursor.y) {
@@ -1477,6 +1494,7 @@ impl Grid {
14771494
if self.cursor.y == self.height.saturating_sub(1) {
14781495
if self.alternate_screen_state.is_none() {
14791496
self.transfer_rows_to_lines_above(1);
1497+
self.hyperlink_tracker.offset_cursor_lines(1);
14801498
} else {
14811499
self.viewport.remove(0);
14821500
}

0 commit comments

Comments
 (0)