Skip to content

Commit 5c38079

Browse files
committed
fix grammars
1 parent e95fda9 commit 5c38079

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

docs/configuration/examples.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ newer and tmux 3.0 or newer.
289289

290290
## `if` conditions
291291

292-
tmuxp enables one to optionally open windows / panes based on coditions. The `if` conditions can appears in the configuration for window or pane.
292+
tmuxp enables one to optionally open windows / panes based on conditions. The `if` conditions can appears in the configuration for window or pane.
293293

294294
````{tab} YAML
295295
@@ -320,7 +320,7 @@ should produce **only** a window with upper and lower split panes (others should
320320
$ show_htop=false tmuxp load examples/if-conditions.yaml
321321
```
322322

323-
will insteads suppress the `htop` command pane and resulting in a different behaviour.
323+
will instead suppress the `htop` command pane and resulting in a different behaviour.
324324

325325
## Focusing
326326

examples/if-conditions.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
"windows": [
88
{
99
"window_name": "window 1 ${ha} $Foo",
10-
"if": {
11-
"shell": "${Foo}"
12-
},
10+
"if": "${Foo}",
1311
"panes": [
1412
{
1513
"shell_command": [
@@ -24,22 +22,25 @@
2422
"panes": [
2523
{
2624
"if": {
27-
"python": "1+1==3"
25+
"shell": "[ 5 -lt 4 ]"
2826
},
2927
"shell_command": [
3028
"echo the above is a false statement"
3129
]
3230
},
3331
{
32+
"if": {
33+
"python": "import os; os.path.isdir('${PWD}')"
34+
},
3435
"shell_command": [
35-
"echo no condition",
36+
"echo \"checking for PWD (${PWD}) is a directory in python\"",
3637
"python -m http.server"
3738
]
3839
},
3940
{
4041
"if": "${show_htop}",
4142
"shell_command": [
42-
"echo the above is a true statement (by default), but can be disabled on-demand",
43+
"echo \"the above is a true statement (by default), but can be disabled on-demand\"",
4344
"htop"
4445
]
4546
}

examples/if-conditions.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ windows:
1212
- echo neither should this $Foo
1313
- window_name: window 2
1414
panes:
15-
# should not shows up; using shell expression
15+
# shell expression condition; should not show up
1616
- if:
1717
shell: '[ 5 -lt 4 ]'
1818
shell_command:
1919
- echo the above is a false statement
20-
# python conditions
20+
# python condition
2121
- if:
2222
python: import os; os.path.isdir('${PWD}')
2323
shell_command:

0 commit comments

Comments
 (0)