summaryrefslogtreecommitdiff
path: root/lua/telescope/previewers.lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2020-11-28 13:33:19 +0100
committerGitHub <noreply@github.com>2020-11-28 13:33:19 +0100
commit7514137e2acade815fec910ceedd9a08b9d5200f (patch)
treec28f55ec31d2c8ad058f44b8d08f0bcb6c66874e /lua/telescope/previewers.lua
parent16f11b6c27f0b14a5a99b3f4802c719c5e6bf2d2 (diff)
Remove less from default termopen_env (#295)
Diffstat (limited to 'lua/telescope/previewers.lua')
-rw-r--r--lua/telescope/previewers.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/lua/telescope/previewers.lua b/lua/telescope/previewers.lua
index a51c17e..e6e2f8c 100644
--- a/lua/telescope/previewers.lua
+++ b/lua/telescope/previewers.lua
@@ -20,7 +20,7 @@ Previewer.__index = Previewer
-- TODO: Should play with these some more, ty @clason
local bat_options = {"--style=plain", "--color=always", "--paging=always"}
local has_less = (vim.fn.executable('less') == 1) and config.values.use_less
-local termopen_env = vim.tbl_extend("force", { ['GIT_PAGER'] = (has_less and 'less' or ''), LESS = '-RS' }, config.values.set_env)
+local termopen_env = vim.tbl_extend("force", { ['GIT_PAGER'] = (has_less and 'less' or '') }, config.values.set_env)
-- TODO(conni2461): Workaround for neovim/neovim#11751. Add only quotes when using else branch.
local valuate_shell = function()
@@ -52,9 +52,9 @@ local bat_maker = function(filename, lnum, start, finish)
if has_less then
if start then
- table.insert(command, {"--pager", string.format("%sless +%s%s", add_quotes, start, add_quotes)})
+ table.insert(command, {"--pager", string.format("%sless -RS +%s%s", add_quotes, start, add_quotes)})
else
- table.insert(command, {"--pager", "less"})
+ table.insert(command, {"--pager", string.format("%sless -RS%s", add_quotes, add_quotes)})
end
else
if start and finish then
@@ -87,9 +87,9 @@ local cat_maker = function(filename, _, start, _)
if has_less then
if start then
- return { 'less', string.format('+%s', start), add_quotes .. vim.fn.expand(filename) .. add_quotes }
+ return { 'less', '-RS', string.format('+%s', start), add_quotes .. vim.fn.expand(filename) .. add_quotes }
else
- return { 'less', add_quotes .. vim.fn.expand(filename) .. add_quotes }
+ return { 'less', '-RS', add_quotes .. vim.fn.expand(filename) .. add_quotes }
end
else
return {