mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-05 02:07:19 +00:00
Updated texlab lsp to reference and respect the pdfViewer options
This commit is contained in:
parent
0e3fc249f6
commit
233490941b
1 changed files with 16 additions and 43 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) isString map;
|
inherit (builtins) isString map;
|
||||||
inherit (lib) optionalAttrs;
|
inherit (lib) optionalAttrs mkDefault;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.config) mkBool;
|
inherit (lib.nvim.config) mkBool;
|
||||||
inherit (lib.options) mkOption mkPackageOption;
|
inherit (lib.options) mkOption mkPackageOption;
|
||||||
|
|
@ -271,45 +271,6 @@ in {
|
||||||
Note this is not all the options, but can act as a guide to help you
|
Note this is not all the options, but can act as a guide to help you
|
||||||
along with custom configs.
|
along with custom configs.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = pdfViewer.package;
|
|
||||||
description = ''
|
|
||||||
The package to use as your PDF viewer.
|
|
||||||
This viewer needs to support Synctex.
|
|
||||||
|
|
||||||
By default it is set to the package of the pdfViewer option.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
executable = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = pdfViewer.executable;
|
|
||||||
description = ''
|
|
||||||
Defines the executable of the PDF previewer. The previewer needs to
|
|
||||||
support SyncTeX.
|
|
||||||
|
|
||||||
By default it is set to the executable of the pdfViewer option.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
args = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
default = pdfViewer.args;
|
|
||||||
description = ''
|
|
||||||
Defines additional arguments that are passed to the configured
|
|
||||||
previewer to perform the forward search.
|
|
||||||
The placeholders `%f`, `%p`, `%l` will be replaced by the server.
|
|
||||||
|
|
||||||
By default it is set to the args of the pdfViewer option.
|
|
||||||
|
|
||||||
Placeholders:
|
|
||||||
- `%f`: The path of the current TeX file.
|
|
||||||
- `%p`: The path of the current PDF file.
|
|
||||||
- `%l`: The current line number.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = {
|
formatter = {
|
||||||
|
|
@ -558,10 +519,10 @@ in {
|
||||||
})
|
})
|
||||||
#
|
#
|
||||||
# -- Forward Search --
|
# -- Forward Search --
|
||||||
// (optionalAttrs texlabCfg.forwardSearch.enable {
|
// (optionalAttrs (texlabCfg.forwardSearch.enable && cfg.pdfViewer.enable) {
|
||||||
forwardSearch = {
|
forwardSearch = {
|
||||||
inherit (texlabCfg.forwardSearch) args;
|
inherit (pdfViewer) args;
|
||||||
executable = "${texlabCfg.forwardSearch.package}/bin/${texlabCfg.forwardSearch.executable}";
|
executable = "${pdfViewer.package}/bin/${pdfViewer.executable}";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
#
|
#
|
||||||
|
|
@ -593,6 +554,18 @@ in {
|
||||||
(mkIf texlabCfg.chktex.enable {
|
(mkIf texlabCfg.chktex.enable {
|
||||||
vim.extraPackages = [texlabCfg.chktex.package];
|
vim.extraPackages = [texlabCfg.chktex.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(
|
||||||
|
mkIf texlabCfg.forwardSearch.enable {
|
||||||
|
vim.languages.tex.pdfViewer.enable = mkDefault true;
|
||||||
|
|
||||||
|
warnings = (
|
||||||
|
lib.lists.optional
|
||||||
|
(!cfg.pdfViewer.enable)
|
||||||
|
"You have enabled forward search but have disabled the PDF viewer. Forward search will not work without the PDF viewer."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
)
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue