nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
MIT License
15.98k stars 837 forks source link

'git_create_branch' not functional #1699

Closed barrett-ruth closed 2 years ago

barrett-ruth commented 2 years ago

Description

telescope action 'git_create_branch' does not allow user to enter branchname when prompted

Neovim version

NVIM v0.7.0-dev+850-ge92b81633
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

macOS 11.5

checkhealth telescope

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.3.0

## ===== Installed extensions =====

## Telescope Extension: `fzy_native`
  - INFO: No healthcheck provided

Steps to reproduce

  1. Be in git repo
  2. nvim -nu minimal.lua
  3. :lua require 'telescope.builtin'.git_branches()
  4. \ to go into normal mode
  5. press \, the default git_create_branch binding
  6. Unable to type branch

Expected behavior

Prompt pops up and one can actually type branch into the prompt

Actual behavior

Prompt with "Please enter the name of the new branch to create" pops up. Unable to enter branch name or type at all -- as if nothing was pressed image

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()]]
l-kershaw commented 2 years ago

From your screenshot, it looks like your Telescope prompt is entry, so there is no name to give the newly created branch.

barrett-ruth commented 2 years ago

Thanks! I didn't understand the workflow for creating a branch would first be to type the name in and then press \, rather than press \ and be prompted for entry on the cmdline. My mistake.