Skip to content

Commit

Permalink
playground changes
Browse files Browse the repository at this point in the history
  • Loading branch information
komkom committed Oct 24, 2021
1 parent bcb4f6e commit 3baca45
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jsonc/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,11 @@ func (a *ArrayState) Next(ru rune, f *Filter) error {
dispatch, err := dispatchComment(f, func() error {

if f.format {
a.fromComment = true
f.pushOutMult(a.lineBreaks, 2, '\n')
if a.lineBreaks > 0 {
f.lastOut = utf8.RuneError
}
a.fromComment = true
a.lineBreaks = 0
}
return nil
Expand Down
9 changes: 9 additions & 0 deletions web/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@

</head>
<body>

<script>
document.onkeyup = function(e) {
if (e.ctrlKey && e.which == 13) {
format()
}
}
</script>

<div class="container">
<section class="intro">
<h1>jsonc Playground</h1>
Expand Down
Binary file modified web/assets/jsonc.wasm
Binary file not shown.
6 changes: 3 additions & 3 deletions web/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ a {

.container {
width: 100%;
max-width: 980px;
max-width: 1024px;
margin: 0 auto;
padding: 0 1rem;
}
Expand Down Expand Up @@ -80,8 +80,8 @@ a {
border: 1px solid #eaeaea;
background-color: #fafafa;
padding: 1rem;
min-height: 18rem;
height: 18rem;
min-height: 25rem;
height: 25rem;
max-height: 18rem !important;
overflow: auto;
}
Expand Down

0 comments on commit 3baca45

Please sign in to comment.