-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(health): add lua health report with updated methods
Fix #422
- Loading branch information
1 parent
3f01a62
commit 97c085b
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
-- vim:sw=2: | ||
-- ============================================================================ | ||
-- FileName: floaterm.vim | ||
-- Author: voldikss <dyzplus@gmail.com> | ||
-- GitHub: https://github.com/voldikss | ||
-- ============================================================================ | ||
|
||
local M = {} | ||
|
||
local get_nvim_info = function() | ||
return vim.fn.split(vim.fn.execute('version'), "\n")[1] | ||
end | ||
|
||
local get_plugin_info = function() | ||
local home = vim.fn.fnamemodify(vim.fn.resolve(vim.fn.expand('<sfile>:p')), ':h:h:h') | ||
local save_cwd = vim.fn.getcwd() | ||
vim.fn.execute('cd ' .. home, 'silent!') | ||
local result = vim.fn.system('git rev-parse --short HEAD') | ||
vim.fn.execute('cd ' .. save_cwd, 'silent!') | ||
return result | ||
end | ||
|
||
local check_common = function() | ||
vim.health.start('common') | ||
vim.health.info('Platform: ' .. vim.uv.os_uname().sysname) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
voldikss
Owner
|
||
vim.health.info('Nvim: ' .. get_nvim_info()) | ||
vim.health.info('Plugin: ' .. get_plugin_info()) | ||
end | ||
|
||
local check_terminal = function() | ||
vim.health.start('terminal') | ||
if vim.fn.exists(':terminal') then | ||
vim.health.ok('Terminal emulator is available') | ||
else | ||
vim.health.error( | ||
'Terminal emulator is missing', | ||
{'Install the latest version of neovim'} | ||
) | ||
end | ||
end | ||
|
||
local check_floating = function() | ||
vim.health.start('floating') | ||
if vim.fn.exists('*nvim_win_set_config') then | ||
vim.health.ok('Floating window is available') | ||
else | ||
vim.health.warn( | ||
'Floating window is missing, will fallback to use normal window', | ||
{'Install the latest version neovim'} | ||
) | ||
end | ||
end | ||
|
||
M.check = function() | ||
check_common() | ||
check_terminal() | ||
check_floating() | ||
end | ||
|
||
return M |
I'm getting an error specifically on this line.
:checkhealth
It doesn't appear that the vim table has a
uv
index.version:
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377
What version of vim/neovim did this work on?