1

Neovim: Disable Telescope preview word wrap

It does not work for previews that don't correspond to files, e.g.
notifications.
This commit is contained in:
2024-10-14 20:13:28 +02:00
parent f7b97521f1
commit dec7d084a8

View File

@ -182,22 +182,24 @@ in {
''; '';
} }
{ # This breaks if the preview buffer does not refer to a file, e.g. when showing previous notifications
# TODO: This breaks if the preview buffer does not refer to a file, # {
# e.g. when showing previous notifications # desc = "Enable line wrapping in telescope preview";
desc = "Enable line wrapping in telescope preview"; # event = ["User"];
event = ["User"]; # pattern = ["TelescopePreviewerLoaded"];
pattern = ["TelescopePreviewerLoaded"]; # callback.__raw = ''
callback.__raw = '' # -- The callback arg is of this format:
function(args) # -- {
if args.data.bufname:match("*.csv") then # -- title: string, # preview window title
vim.wo.wrap = false # -- filetype: string,
else # -- bufname: string,
vim.wo.wrap = true # -- }
end
end # function(args)
''; # vim.wo.wrap = true
} # end
# '';
# }
]; ];
keymaps = import ./mappings.nix {inherit lib mylib;}; keymaps = import ./mappings.nix {inherit lib mylib;};