Compare commits

...

8 commits

Author SHA1 Message Date
DamitusThyYeetus123
a91d6d026c
Merge bd9fe9eb68 into 48bcd5d695 2024-12-09 21:08:28 +01:00
48bcd5d695
visuals/indent-blankline: properly pass setupOpts to mkPluginSetupOption 2024-12-09 17:59:19 +03:00
raf
bd9fe9eb68
Merge branch 'main' into v0.7 2024-12-06 15:57:58 +03:00
raf
5b2ab22777
Merge branch 'main' into v0.7 2024-12-04 17:48:44 +03:00
damii
6d07646fae Fix formatting 2024-12-04 09:35:25 +11:00
Ching Pei Yang
14de965ce9
formatting 2024-12-03 01:31:48 +01:00
DamitusThyYeetus123
234ad31909
Merge branch 'NotAShelf:v0.7' into v0.7 2024-12-03 09:13:34 +11:00
DamitusThyYeetus123
73cc5edd31 nvim-tree: Add directory opening 2024-11-12 13:25:08 +11:00
2 changed files with 10 additions and 2 deletions

View file

@ -77,6 +77,9 @@ in {
-- buffer is a real file on the disk -- buffer is a real file on the disk
local real_file = vim.fn.filereadable(data.file) == 1 local real_file = vim.fn.filereadable(data.file) == 1
-- buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1
-- buffer is a [No Name] -- buffer is a [No Name]
local no_name = data.file == "" and vim.bo[data.buf].buftype == "" local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
@ -84,7 +87,7 @@ in {
local filetype = vim.bo[data.buf].ft local filetype = vim.bo[data.buf].ft
-- only files please -- only files please
if not real_file and not no_name then if not real_file and not directory and not no_name then
return return
end end
@ -93,6 +96,10 @@ in {
return return
end end
-- cd if buffer is a directory
if directory then
vim.cmd.cd(data.file)
end
-- open the tree but don't focus it -- open the tree but don't focus it
require("nvim-tree.api").tree.toggle({ focus = false }) require("nvim-tree.api").tree.toggle({ focus = false })
end end

View file

@ -6,6 +6,7 @@
inherit (lib.modules) mkRenamedOptionModule; inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.options) mkOption mkEnableOption literalExpression; inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) int bool str nullOr either listOf attrsOf; inherit (lib.types) int bool str nullOr either listOf attrsOf;
inherit (lib.nvim.types) mkPluginSetupOption;
cfg = config.vim.visuals; cfg = config.vim.visuals;
in { in {
@ -15,7 +16,7 @@ in {
options.vim.visuals.indent-blankline = { options.vim.visuals.indent-blankline = {
enable = mkEnableOption "indentation guides [indent-blankline]"; enable = mkEnableOption "indentation guides [indent-blankline]";
setupOpts = { setupOpts = mkPluginSetupOption "indent-blankline" {
debounce = mkOption { debounce = mkOption {
type = int; type = int;
description = "Debounce time in milliseconds"; description = "Debounce time in milliseconds";