-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
556 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Release 0.8 {#sec-release-0.8} | ||
|
||
[NotAShelf](https://github.com/notashelf): | ||
|
||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim | ||
|
||
- Add [typst-preview.nvim] under | ||
`languages.typst.extensions.typst-preview-nvim`. | ||
|
||
- Add a search widget to the options page in the nvf manual. | ||
|
||
[amadaluzia](https://github.com/amadaluzia): | ||
|
||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim | ||
|
||
- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim]. | ||
|
||
[diniamo](https://github.com/diniamo): | ||
|
||
- Add Odin support under `vim.languages.odin`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
document.addEventListener("DOMContentLoaded", () => { | ||
if (!window.location.pathname.endsWith("options.html")) return; | ||
|
||
const searchDiv = document.createElement("div"); | ||
searchDiv.id = "search-bar"; | ||
searchDiv.innerHTML = ` | ||
<input type="text" id="search-input" placeholder="Search options by ID..." /> | ||
<div id="search-results"></div> | ||
`; | ||
document.body.prepend(searchDiv); | ||
|
||
const dtElements = Array.from(document.querySelectorAll("dt")); | ||
const ddElements = Array.from(document.querySelectorAll("dd")); | ||
const dtOptionIds = dtElements.map( | ||
(dt) => dt.querySelector("a")?.id.toLowerCase() || "", | ||
); | ||
|
||
if (dtElements.length === 0 || ddElements.length === 0) { | ||
console.warn("Something went wrong, page may be loaded incorrectly."); | ||
return; | ||
} | ||
|
||
const dtElementsData = dtElements.map((dt, index) => ({ | ||
element: dt, | ||
id: dtOptionIds[index], | ||
ddElement: ddElements[index], | ||
})); | ||
|
||
const hiddenClass = "hidden"; | ||
const hiddenStyle = document.createElement("style"); | ||
hiddenStyle.innerHTML = `.${hiddenClass} { display: none; }`; | ||
document.head.appendChild(hiddenStyle); | ||
|
||
let debounceTimeout; | ||
document.getElementById("search-input").addEventListener("input", (event) => { | ||
clearTimeout(debounceTimeout); | ||
debounceTimeout = setTimeout(() => { | ||
const query = event.target.value.toLowerCase(); | ||
|
||
const matches = []; | ||
const nonMatches = []; | ||
|
||
dtElementsData.forEach(({ element, id, ddElement }) => { | ||
const isMatch = id.includes(query); | ||
if (isMatch) { | ||
matches.push(element, ddElement); | ||
} else { | ||
nonMatches.push(element, ddElement); | ||
} | ||
}); | ||
|
||
requestAnimationFrame(() => { | ||
matches.forEach((el) => el?.classList.remove(hiddenClass)); | ||
nonMatches.forEach((el) => el?.classList.add(hiddenClass)); | ||
}); | ||
}, 200); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.