Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Dec 3, 2023
1 parent dd8b484 commit ae3de6c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions package/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ <h2>Web component</h2>
</select>
</div>
</div>
<button class="btn" style="width: max-content;">Open search</button>
<prism-editor line-numbers language="typescript" theme="github-dark"></prism-editor>
</section>
<section>
Expand Down
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prism-code-editor",
"version": "2.2.2",
"version": "2.2.3",
"type": "module",
"description": "Lightweight, extensible code editor component for the web using Prism",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion package/src/extensions/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const defaultCommands = (
value: string,
wrapOnly?: boolean,
) =>
(start != end ||
(start < end ||
(!wrapOnly && selfCloseRegex.test((value[end - 1] || " ") + open + (value[end] || " ")))) &&
!insertText(editor, open + value.slice(start, end) + close, null, null, start + 1, end + 1)!

Expand Down
2 changes: 1 addition & 1 deletion package/src/extensions/search/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const highlightCurrentWord = (
editor.addListener("update", () => (noHighlight = true))

return ([start, end], value) => {
if (start != end || !editor.focused || noHighlight) searchAPI.search("")
if (start < end || !editor.focused || noHighlight) searchAPI.search("")
else {
let group = `[\\p{L}_$\\d${includeHyphens && includeHyphens(start) ? "-" : ""}]*`
let before = value.slice(0, start).match(RegExp(group + "$", "u"))!
Expand Down
4 changes: 4 additions & 0 deletions package/src/testsite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,7 @@ readonlyEditor.addEventListener("ready", () => {
})

addOverscroll(editor)

document.querySelector<HTMLElement>("button.btn")!.onclick = () => {
editor2.extensions.searchWidget!.open()
}

0 comments on commit ae3de6c

Please sign in to comment.