Skip to content

Commit

Permalink
fix scrolling not working in term previewers for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
searleser97 committed Dec 14, 2023
1 parent 4522d7e commit 930639e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/telescope/previewers/term_previewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ previewers.new_termopen_previewer = function(opts)
return
end

vim.fn.chansend(term_id, termcode)
vim.fn.chansend(term_id, termcode .. (utils.is_windows() and "\r\n" or ""))
vim.api.nvim_buf_call(self.state.termopen_bufnr, function() vim.cmd("normal! G") end)
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions lua/telescope/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ local get_status = require("telescope.state").get_status

local utils = {}

utils.is_windows = function()
return package.config:sub(1,1) == "\\";
end

utils.get_separator = function()
return Path.path.sep
end
Expand Down

0 comments on commit 930639e

Please sign in to comment.