feat: make visible borders optional

This commit is contained in:
raf 2023-07-23 18:26:38 +03:00
parent eaab87d151
commit cf48beb8e6
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
5 changed files with 23 additions and 2 deletions

View file

@ -200,12 +200,13 @@ in {
local cmp = require'cmp' local cmp = require'cmp'
cmp.setup({ cmp.setup({
${optionalString (config.vim.ui.borders.enable) ''
-- explicitly enabled by setting ui.borders.enable = true
window = { window = {
-- TODO: at some point, those need to be optional
-- but first nvim cmp module needs to be detached from "cfg.autocomplete"
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
''}
snippet = { snippet = {
expand = function(args) expand = function(args)

View file

@ -16,6 +16,11 @@ in {
vim.luaConfigRC.lspconfig = nvim.dag.entryAfter ["lsp-setup"] '' vim.luaConfigRC.lspconfig = nvim.dag.entryAfter ["lsp-setup"] ''
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
${
# TODO: make border style configurable
optionalString (config.vim.ui.borders.enable) "require('lspconfig.ui.windows').default_options.border = 'single'"
}
''; '';
} }
{ {

View file

@ -0,0 +1,9 @@
{lib, ...}: let
inherit (lib) mkEnableOption mkOption;
in {
options.vim.ui.borders = {
enable = mkEnableOption "visible borders for most windows";
# TODO: make per-plugin borders configurable
};
}

View file

@ -0,0 +1,5 @@
_: {
imports = [
./borders.nix
];
}

View file

@ -6,5 +6,6 @@ _: {
./smartcolumn ./smartcolumn
./colorizer ./colorizer
./illuminate ./illuminate
./borders
]; ];
} }