aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/provider/clipboard
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-05-22 20:40:20 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-05-22 21:34:49 +0200
commit01b4da65c229f05ccb26c55db4e0d30ed9bac10b (patch)
tree19b4f2b4c0fc84cba27270239bf9dc03e35c3c87 /runtime/lua/vim/provider/clipboard
parente8f7025de1d8b7c8bbe747736e4c46dcd6e73133 (diff)
downloadrneovim-01b4da65c229f05ccb26c55db4e0d30ed9bac10b.tar.gz
rneovim-01b4da65c229f05ccb26c55db4e0d30ed9bac10b.tar.bz2
rneovim-01b4da65c229f05ccb26c55db4e0d30ed9bac10b.zip
fix: merge all provider healthchecks into a single health.lua
This will help manage the overly granular checkhealth completion to go from ``` vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` to ``` vim.health vim.lsp vim.provider vim.treesitter ```
Diffstat (limited to 'runtime/lua/vim/provider/clipboard')
-rw-r--r--runtime/lua/vim/provider/clipboard/health.lua39
1 files changed, 0 insertions, 39 deletions
diff --git a/runtime/lua/vim/provider/clipboard/health.lua b/runtime/lua/vim/provider/clipboard/health.lua
deleted file mode 100644
index 0af6a44330..0000000000
--- a/runtime/lua/vim/provider/clipboard/health.lua
+++ /dev/null
@@ -1,39 +0,0 @@
-local health = vim.health
-
-local M = {}
-
-function M.check()
- health.start('Clipboard (optional)')
-
- if
- os.getenv('TMUX')
- and vim.fn.executable('tmux') == 1
- and vim.fn.executable('pbpaste') == 1
- and not health._cmd_ok('pbpaste')
- then
- local tmux_version = string.match(vim.fn.system('tmux -V'), '%d+%.%d+')
- local advice = {
- 'Install tmux 2.6+. https://superuser.com/q/231130',
- 'or use tmux with reattach-to-user-namespace. https://superuser.com/a/413233',
- }
- health.error('pbcopy does not work with tmux version: ' .. tmux_version, advice)
- end
-
- local clipboard_tool = vim.fn['provider#clipboard#Executable']()
- if vim.g.clipboard ~= nil and clipboard_tool == '' then
- local error_message = vim.fn['provider#clipboard#Error']()
- health.error(
- error_message,
- "Use the example in :help g:clipboard as a template, or don't set g:clipboard at all."
- )
- elseif clipboard_tool:find('^%s*$') then
- health.warn(
- 'No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.',
- ':help clipboard'
- )
- else
- health.ok('Clipboard tool found: ' .. clipboard_tool)
- end
-end
-
-return M