mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 16:59:48 +01:00
Compare commits
1 commit
ed3ec2c1e6
...
545791df67
Author | SHA1 | Date | |
---|---|---|---|
545791df67 |
6 changed files with 13 additions and 106 deletions
|
@ -1,8 +0,0 @@
|
||||||
# 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`.
|
|
21
docs/static/script/search.js
vendored
21
docs/static/script/search.js
vendored
|
@ -1,12 +1,14 @@
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
if (!window.location.pathname.endsWith("options.html")) return;
|
if (!window.location.pathname.endsWith("options.html")) return;
|
||||||
|
|
||||||
|
const searchBar = document.createDocumentFragment();
|
||||||
const searchDiv = document.createElement("div");
|
const searchDiv = document.createElement("div");
|
||||||
searchDiv.id = "search-bar";
|
searchDiv.id = "search-bar";
|
||||||
searchDiv.innerHTML = `
|
searchDiv.innerHTML = `
|
||||||
<input type="text" id="search-input" placeholder="Search options by ID..." />
|
<input type="text" id="search-input" placeholder="Search options by ID..." />
|
||||||
<div id="search-results"></div>
|
<div id="search-results"></div>
|
||||||
`;
|
`;
|
||||||
|
searchBar.appendChild(searchDiv);
|
||||||
document.body.prepend(searchDiv);
|
document.body.prepend(searchDiv);
|
||||||
|
|
||||||
const dtElements = Array.from(document.querySelectorAll("dt"));
|
const dtElements = Array.from(document.querySelectorAll("dt"));
|
||||||
|
@ -20,28 +22,19 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dtElementsData = dtElements.map((dt, index) => ({
|
|
||||||
element: dt,
|
|
||||||
id: dtOptionIds[index],
|
|
||||||
ddElement: ddElements[index],
|
|
||||||
}));
|
|
||||||
|
|
||||||
let debounceTimeout;
|
let debounceTimeout;
|
||||||
document.getElementById("search-input").addEventListener("input", (event) => {
|
document.getElementById("search-input").addEventListener("input", (event) => {
|
||||||
clearTimeout(debounceTimeout);
|
clearTimeout(debounceTimeout);
|
||||||
debounceTimeout = setTimeout(() => {
|
debounceTimeout = setTimeout(() => {
|
||||||
const query = event.target.value.toLowerCase();
|
const query = event.target.value.toLowerCase();
|
||||||
|
dtElements.forEach((dt, index) => {
|
||||||
|
const isMatch = dtOptionIds[index].includes(query);
|
||||||
|
|
||||||
requestAnimationFrame(() => {
|
if (dt.classList.contains("hidden") !== !isMatch) {
|
||||||
const fragment = document.createDocumentFragment();
|
dt.classList.toggle("hidden", !isMatch);
|
||||||
dtElementsData.forEach(({ element, id, ddElement }) => {
|
ddElements[index]?.classList.toggle("hidden", !isMatch);
|
||||||
const isMatch = id.includes(query);
|
|
||||||
if (element.classList.contains("hidden") !== !isMatch) {
|
|
||||||
element.classList.toggle("hidden", !isMatch);
|
|
||||||
ddElement?.classList.toggle("hidden", !isMatch);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
17
flake.lock
17
flake.lock
|
@ -1902,22 +1902,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugin-typst-preview-nvim": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733120663,
|
|
||||||
"narHash": "sha256-uYMZ2PONiiI3UDvCgNvyy4+jhzmUDbAyxX0phKxELXw=",
|
|
||||||
"owner": "chomosuke",
|
|
||||||
"repo": "typst-preview.nvim",
|
|
||||||
"rev": "0cb5f5627312f50ce089f785ec42b55a85f30ce7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "chomosuke",
|
|
||||||
"repo": "typst-preview.nvim",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plugin-vim-dirtytalk": {
|
"plugin-vim-dirtytalk": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -2167,7 +2151,6 @@
|
||||||
"plugin-tokyonight": "plugin-tokyonight",
|
"plugin-tokyonight": "plugin-tokyonight",
|
||||||
"plugin-trouble": "plugin-trouble",
|
"plugin-trouble": "plugin-trouble",
|
||||||
"plugin-ts-error-translator": "plugin-ts-error-translator",
|
"plugin-ts-error-translator": "plugin-ts-error-translator",
|
||||||
"plugin-typst-preview-nvim": "plugin-typst-preview-nvim",
|
|
||||||
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
|
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
|
||||||
"plugin-vim-fugitive": "plugin-vim-fugitive",
|
"plugin-vim-fugitive": "plugin-vim-fugitive",
|
||||||
"plugin-vim-illuminate": "plugin-vim-illuminate",
|
"plugin-vim-illuminate": "plugin-vim-illuminate",
|
||||||
|
|
|
@ -206,11 +206,6 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-typst-preview-nvim = {
|
|
||||||
url = "github:chomosuke/typst-preview.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-metals = {
|
plugin-nvim-metals = {
|
||||||
url = "github:scalameta/nvim-metals";
|
url = "github:scalameta/nvim-metals";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
@ -7,13 +7,10 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) nullOr enum either attrsOf listOf package str;
|
inherit (lib.types) enum either listOf package str;
|
||||||
inherit (lib.attrsets) attrNames;
|
inherit (lib.attrsets) attrNames;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.typst;
|
cfg = config.vim.languages.typst;
|
||||||
|
|
||||||
|
@ -36,7 +33,6 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
tinymist = {
|
tinymist = {
|
||||||
package = pkgs.tinymist;
|
package = pkgs.tinymist;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
|
@ -124,50 +120,6 @@ in {
|
||||||
default = formats.${cfg.format.type}.package;
|
default = formats.${cfg.format.type}.package;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extensions = {
|
|
||||||
typst-preview-nvim = {
|
|
||||||
enable =
|
|
||||||
mkEnableOption ''
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
|
||||||
|
|
||||||
Low latency typst preview for Neovim via [typst-preview.nvim]
|
|
||||||
''
|
|
||||||
// {default = true;};
|
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "typst-preview-nvim" {
|
|
||||||
open_cmd = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
example = "firefox %s -P typst-preview --class typst-preview";
|
|
||||||
description = ''
|
|
||||||
Custom format string to open the output link provided with `%s`
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
dependencies_bin = mkOption {
|
|
||||||
type = attrsOf str;
|
|
||||||
default = {
|
|
||||||
"tinymist" = getExe servers.tinymist.package;
|
|
||||||
"websocat" = getExe pkgs.websocat;
|
|
||||||
};
|
|
||||||
|
|
||||||
description = ''
|
|
||||||
Provide the path to binaries for dependencies. Setting this
|
|
||||||
to a non-null value will skip the download of the binary by
|
|
||||||
the plugin.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extra_args = mkOption {
|
|
||||||
type = nullOr (listOf str);
|
|
||||||
default = null;
|
|
||||||
example = ["--input=ver=draft" "--ignore-system-fonts"];
|
|
||||||
description = "A list of extra arguments (or `null`) to be passed to previewer";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
|
@ -184,13 +136,5 @@ in {
|
||||||
vim.lsp.lspconfig.enable = true;
|
vim.lsp.lspconfig.enable = true;
|
||||||
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
# Extensions
|
|
||||||
(mkIf cfg.extensions.typst-preview-nvim.enable {
|
|
||||||
vim.startPlugins = ["typst-preview-nvim"];
|
|
||||||
vim.pluginRC.typst-preview-nvim = entryAnywhere ''
|
|
||||||
require("typst-preview").setup(${toLuaObject cfg.extensions.typst-preview-nvim.setupOpts})
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"release": "v0.8",
|
"release": "v0.7",
|
||||||
"isReleaseBranch": false
|
"isReleaseBranch": true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue