Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telescope broken on Windows 10 after latest update #1144

Closed
rkakkar123 opened this issue Aug 21, 2021 · 5 comments · Fixed by #1169
Closed

Telescope broken on Windows 10 after latest update #1144

rkakkar123 opened this issue Aug 21, 2021 · 5 comments · Fixed by #1169
Labels
bug Something isn't working

Comments

@rkakkar123
Copy link

Description

After the latest update, Telescope is adding a ^M at the end of every file and hence opening a blank file

image

Neovim version

NVIM v0.5.0

Operating system and version

Microsoft Windows 10 Enterprise

Steps to reproduce

  1. nvim -nu minimal.lua
  2. ...

Expected behavior

No response

Actual behavior

As described above

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
@rkakkar123 rkakkar123 added the bug Something isn't working label Aug 21, 2021
@dhruvmanila
Copy link
Contributor

You have not filled out the Steps to reproduce section. It would make the maintainers life really easy if you could reproduce using the minimal config they have provided adding in all the necessary information.

@Conni2461
Copy link
Member

I am pretty sure this is caused by this part

local start = index
index = string.find(text, "\n", index, true)
if index == nil then
text = get_next_text(string.sub(text, start or 1))
return next_value()
end
index = index + 1
return string.sub(text, start or 1, index - 2)
Its a new implementation of the previous job implementation and i think we need to remove \r\n for windows and only \n for everyone else.

I am thinking about a good realization of this but maybe on new we pick either this function of a different one based on OS

@tjdevries
Copy link
Member

Does this fix it? #1169 I don't have an easy way to test at the moment

@Remoat
Copy link

Remoat commented Aug 26, 2021

Fixes it for me at least.

@tjdevries
Copy link
Member

OK, I've merged. Please let me know if any of you sees something going wrong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants