Use a different saner syntax for pcall

takes less lines, looks much better

remove neoscroll.lua, missed in 2952f4d5c7
This commit is contained in:
Akianonymus
2021-07-17 16:44:52 +05:30
parent 1d7602e3e4
commit 9c1a3ad2a2
17 changed files with 56 additions and 158 deletions

View File

@@ -1,11 +1,6 @@
local packer
if
not pcall(
function()
packer = require "packer"
end
)
then
local present, packer = pcall(require, "packer")
if not present then
local packer_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
print("Cloning packer..")
@@ -21,12 +16,10 @@ if
packer_path
}
)
if pcall(
function()
packer = require "packer"
end
)
then
present, packer = pcall(require, "packer")
if present then
print("Packer cloned successfully.")
else
error("Couldn't clone packer !\nPacker path: " .. packer_path)