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:
@ -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;};
|
||||||
|
Reference in New Issue
Block a user