Skip to content

Commit a61fff6

Browse files
authored
Merge pull request #5275 from Tyriar/liga-test
Demo test button for common ligatures
2 parents 601efc3 + cd5438c commit a61fff6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

demo/client.ts

+15
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ if (document.location.pathname === '/test') {
240240
document.getElementById('add-decoration').addEventListener('click', addDecoration);
241241
document.getElementById('add-overview-ruler').addEventListener('click', addOverviewRuler);
242242
document.getElementById('decoration-stress-test').addEventListener('click', decorationStressTest);
243+
document.getElementById('ligatures-test').addEventListener('click', ligaturesTest);
243244
document.getElementById('weblinks-test').addEventListener('click', testWeblinks);
244245
document.getElementById('bce').addEventListener('click', coloredErase);
245246
addVtButtons();
@@ -1307,6 +1308,20 @@ function addVtButtons(): void {
13071308
document.querySelector('#vt-container').appendChild(vtFragment);
13081309
}
13091310

1311+
function ligaturesTest(): void {
1312+
term.write([
1313+
'',
1314+
'-<< -< -<- <-- <--- <<- <- -> ->> --> ---> ->- >- >>-',
1315+
'=<< =< =<= <== <=== <<= <= => =>> ==> ===> =>= >= >>=',
1316+
'<-> <--> <---> <----> <=> <==> <===> <====> :: ::: __',
1317+
'<~~ </ </> /> ~~> == != /= ~= <> === !== !=== =/= =!=',
1318+
'<: := *= *+ <* <*> *> <| <|> |> <. <.> .> +* =* =: :>',
1319+
'(* *) /* */ [| |] {| |} ++ +++ \/ /\ |- -| <!-- <!---',
1320+
'==== ===== ====== ======= ======== =========',
1321+
'---- ----- ------ ------- -------- ---------'
1322+
].join('\r\n'));
1323+
}
1324+
13101325
function testWeblinks(): void {
13111326
const linkExamples = `
13121327
aaa http://example.com aaa http://example.com aaa

demo/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ <h3>Test</h3>
106106
<dd><button id="add-overview-ruler" title="Add an overview ruler to the terminal">Add Overview Ruler</button></dd>
107107
<dd><button id="decoration-stress-test" title="Toggle between adding and removing a decoration to each line">Stress Test</button></dd>
108108

109+
<dt>Ligatures Addon</dt>
110+
<dd><button id="ligatures-test" title="Write common ligatures sequences">Common ligatures</button></dd>
111+
109112
<dt>Weblinks Addon</dt>
110113
<dd><button id="weblinks-test" title="Various url conditions from demo data, hover&click to test">Test URLs</button></dd>
111114

0 commit comments

Comments
 (0)