Skip to content

Commit

Permalink
fix(resurrection): various serialization issues (#3636)
Browse files Browse the repository at this point in the history
* fix(serialization): use kdl-rs for serialization

* style(fmt): remove dead code

* tests(serialization): update snapshots

* style(fmt): rustfmt
  • Loading branch information
imsnif authored Oct 2, 2024
1 parent 0c8787d commit 0511ae1
Show file tree
Hide file tree
Showing 12 changed files with 1,217 additions and 296 deletions.
1,198 changes: 902 additions & 296 deletions zellij-utils/src/session_serialization.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 2025
expression: kdl.0
---
layout {
tab name="First tab" {
}
tab name="Second tab" {
pane split_direction="vertical" {
pane size=10
pane size=10
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 2047
expression: kdl.0
---
layout {
new_tab_template {
pane
pane
floating_panes {
pane {
}
pane {
}
pane {
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 2111
expression: kdl.0
---
layout {
swap_floating_layout {
floating_panes max_panes=1 {
pane {
}
pane {
}
pane {
}
}
floating_panes min_panes=1 {
pane {
}
pane {
}
pane {
}
}
floating_panes exact_panes=1 {
pane {
}
pane {
}
pane {
}
}
floating_panes {
pane {
}
pane {
}
pane {
}
}
}
swap_floating_layout name="swap_floating_layout_2" {
floating_panes max_panes=2 {
pane {
}
pane {
}
pane {
}
}
floating_panes min_panes=2 {
pane {
}
pane {
}
pane {
}
}
floating_panes exact_panes=2 {
pane {
}
pane {
}
pane {
}
}
floating_panes {
pane {
}
pane {
}
pane {
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 2079
expression: kdl.0
---
layout {
swap_tiled_layout {
tab max_panes=1 {
pane
pane
}
tab min_panes=1 {
pane
pane
}
tab exact_panes=1 {
pane
pane
}
tab {
pane
pane
}
}
swap_tiled_layout name="swap_tiled_layout_2" {
tab max_panes=2 {
pane
pane
}
tab min_panes=2 {
pane
pane
}
tab exact_panes=2 {
pane
pane
}
tab {
pane
pane
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 1654
expression: kdl.0
---
layout {
tab name="Tab #1" focus=true {
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 1667
expression: kdl.0
---
layout {
tab name="Tab #1" hide_floating_panes=true {
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 1641
expression: kdl.0
---
layout {
tab name="my \"tab \\name" {
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 1929
expression: kdl.0
---
layout {
tab name="Tab with \"floating panes\"" {
floating_panes {
pane {
height 10
width 10
x 0
y 0
}
pane cwd="/tmp/\"my/cool cwd" {
height 10
width 10
x 0
y 10
}
pane edit="/tmp/\"my/cool cwd/my-file" {
height 10
width 10
x 0
y 20
}
pane command="/tmp/\"my/cool cwd/command.sh" {
start_suspended true
height 10
width 10
x 0
y 30
}
pane command="/tmp/\"my/cool cwd/command.sh" {
start_suspended true
height 10
width 10
x 0
y 40
args "--arg1" "arg\"2" "arg > \\3"
}
pane {
height 10
width 10
x 0
y 50
plugin location="file:/tmp/\"my/cool cwd/plugin.wasm"
}
pane {
height 10
width 10
x 0
y 60
plugin location="file:/tmp/\"my/cool cwd/plugin.wasm" {
"key 1\"\\" "val 1\"\\"
"key 2\"\\" "val 2\"\\"
}
}
pane {
height 10
width 10
x 0
y 70
}
pane name="my cool \\ \"pane_title\"" focus=true contents_file="initial_contents_1" {
height 10
width 10
x 0
y 80
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 1973
expression: kdl.0
---
layout {
tab name="Tab with \"stacked panes\"" {
pane stacked=true {
pane
pane expanded=true
pane
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 1799
expression: kdl.0
---
layout {
tab name="Tab with \"tiled panes\"" {
pane size=10
pane cwd="/tmp/\"my/cool cwd" size=10
pane edit="/tmp/\"my/cool cwd/my-file" size=10
pane command="/tmp/\"my/cool cwd/command.sh" size=10 {
start_suspended true
}
pane command="/tmp/\"my/cool cwd/command.sh" size=10 {
args "--arg1" "arg\"2" "arg > \\3"
start_suspended true
}
pane size=10 {
plugin location="file:/tmp/\"my/cool cwd/plugin.wasm"
}
pane size=10 {
plugin location="file:/tmp/\"my/cool cwd/plugin.wasm" {
"key 1\"\\" "val 1\"\\"
"key 2\"\\" "val 2\"\\"
}
}
pane size=10 borderless=true
pane name="my cool \\ \"pane_title\"" focus=true contents_file="initial_contents_1" size=10
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
source: zellij-utils/src/session_serialization.rs
assertion_line: 1168
expression: kdl.0
---
layout {
cwd "/path/to/m\"y/global cwd"
}

0 comments on commit 0511ae1

Please sign in to comment.