wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.72k stars 263 forks source link

Packer always gives "Expected Lua number" error in display.lua line 932 #1230

Closed pupto-bismol closed 1 year ago

pupto-bismol commented 1 year ago

Steps to reproduce

Use packer.nvim bootstrap script from http://neovimcraft.com/plugin/wbthomason/packer.nvim/index.html, as well as require packer with a protected call - this is in my plugins.lua after the bootstrap code

local status_ok, packer = pcall(require, 'packer')
if not status_ok then
  vim.notify('packer did not require properly')
  return
end

return packer.startup(function(use)
  use 'wbthomason/packer.nvim'
  ...

  if packer_bootstrap then
    require ('packer').sync()
  end
end)

Then source plugins file and try to run PackerSync or PackerStatus.

Actual behaviour

neovim gives: [packer.nvim] [ERROR 14:18:10] async.lua:20: Error in coroutine: ...ite/pack/packer/start/packer.nvim/lua/packer/display.lua:932: Expected Lua number at this point no Packer... commands will work and no plugins are loaded.

inspecting display.lua around line 932:

--- Utility to make the initial display buffer header
local function make_header(disp)
  local width = api.nvim_win_get_width(0)
  local pad_width = math.floor((width - string.len(config.title)) / 2.0)
  api.nvim_buf_set_lines(disp.buf, 0, 1, true, {
    string.rep(' ', pad_width) .. config.title,
    ' ' .. string.rep(config.header_sym, width - 2),
  })
end

where line 932 is api.nvim_buf_set_lines...

Expected behaviour

packer.nvim loads normally and I can use my plugins or Packer commands

I think this is just an issue with the code block around line 932 but I get no responses from a google search and I'm unsure what the problem is or how to fix it as I'm not familiar with lua beyond config files. I've also tried just removing the whole packer.nvim directory and then restarting nvim, which just gives the same issue.

pupto-bismol commented 1 year ago

was stupid and messed up a plugin url!! oopsies working now

pupto-bismol commented 1 year ago

sorry for the mess but that was a hasty close. it did not in fact work. in fact after commenting out every plugin expect for just wbthomason/packer.nvim the same issue still happens

pupto-bismol commented 1 year ago

turned out to be a similar problem to https://github.com/wbthomason/packer.nvim/issues/883#issuecomment-1152517197 so nvm about all that