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

Cursor starts at column 2 #330

Closed
ghost opened this issue Nov 6, 2023 · 4 comments
Closed

Cursor starts at column 2 #330

ghost opened this issue Nov 6, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Nov 6, 2023

Description

When opening a file with the telescope-file-browser plugin, whether through a keymap or when opening a directory with Neovim, the cursors start at column 2.

Neovim version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1692716794

Operating system and version

WSL2 - Debian GNU/Linux 12 (bookworm)

Steps to reproduce

  • nvim .
  • <leader>f (my keybinding)

Expected behavior

Cursor starts at column 1.

Actual behavior

Cursor starts at column 2.

image
image

(Sorry I couldn't upload screen record our internet speed is crawling)

Minimal config

vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { noremap = true, silent = true })

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

local plugins = {
  {
    "nvim-telescope/telescope-file-browser.nvim",
    dependencies = {
      "nvim-telescope/telescope.nvim",
      "nvim-lua/plenary.nvim",
    },
    config = function()
      extensions = {
        file_browser = {
          theme = "dropdown",
          grouped = true,
          hidden = true,
          hijack_netrw = true,
          git_status = true,
          prompt_path = true,
          initial_mode = "normal",
          previewer = false,
          mappings = {
            i = { ["<C-o>"] = false },
            n = { ["<o>"] = false },
          },
        },
      },

    pcall(require("telescope").load_extension, "file_browser")

    vim.api.nvim_set_keymap( 'n', '<leader>f', ':Telescope file_browser path=%:p:h select_buffer=true<CR>', { desc = '[F]ile Browser' })

    end
  },
}

require("lazy").setup(plugins, {})
@ghost ghost added the bug Something isn't working label Nov 6, 2023
@ghost ghost changed the title Opening a file with telescope-file-browser starts at column 2 Opening a file with telescope-file-browser cursor starts at column 2 Nov 6, 2023
@ghost ghost changed the title Opening a file with telescope-file-browser cursor starts at column 2 Cursor start at column 2 Nov 6, 2023
@ghost ghost changed the title Cursor start at column 2 Cursor starts at column 2 Nov 6, 2023
@jamestrew
Copy link
Collaborator

Hey, thanks for the report.
I think this is an issue we're tracking in upstream telescope. The action where using in telescope-file-browser is from upstream so I don't think this is unique to this telescope extension.
nvim-telescope/telescope.nvim#2319

That said, do you experience this every time you open the file?

@ghost
Copy link
Author

ghost commented Nov 7, 2023

That said, do you experience this every time you open the file?

Yes, but I only experience it when using telescope-file-browser.

@ghost
Copy link
Author

ghost commented Nov 7, 2023

@jamestrew

Based on what I observe throughout my day, it appears that this issue only occurs when you are in Telescope's normal mode (i.e., when exiting insert mode within Telescope) and then enter a file. This weird cursor behavior doesn't seem to manifest when entering a file in Telescope without exiting insert mode.

@jamestrew
Copy link
Collaborator

Ok yeah you're right it's a normal mode issue. It also happens with :Telescope find_files for me.
It's definitely an upstream issue that we're tracking so I'll close this one.

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

No branches or pull requests

1 participant