mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
update format time out
This commit is contained in:
parent
f7624d9bd0
commit
4486409c44
2 changed files with 17 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"ChatGPT.nvim": { "branch": "main", "commit": "c33babb015005cda6042f908ac587e4bc498d041" },
|
||||
"ChatGPT.nvim": { "branch": "main", "commit": "d529fc291472e8595a8ef35523a7f39341532a8b" },
|
||||
"Comment.nvim": { "branch": "master", "commit": "97a188a98b5a3a6f9b1b850799ac078faa17ab67" },
|
||||
"LuaSnip": { "branch": "master", "commit": "563827f00bb4fe43269e3be653deabc0005f1302" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" },
|
||||
|
@ -12,7 +12,7 @@
|
|||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"code_runner.nvim": { "branch": "main", "commit": "00d3b82cc4ff0a1e0eabd09bbf125d95490d216f" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "320865dfe76c03a5c60513d4f34ca22effae56f2" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "046e4d3491baf664e0eef5231d28beb49333578b" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "2c6f96dda47e55fa07052ce2e2141e8367cbaaf2" },
|
||||
"impatient.nvim": { "branch": "main", "commit": "b842e16ecc1a700f62adb9802f8355b99b52a5a6" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" },
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
function format_filter(client)
|
||||
local filetype = vim.bo.filetype
|
||||
local n = require "null-ls"
|
||||
local s = require "null-ls.sources"
|
||||
local n = require("null-ls")
|
||||
local s = require("null-ls.sources")
|
||||
local method = n.methods.FORMATTING
|
||||
local available_formatters = s.get_available(filetype, method)
|
||||
|
||||
if #available_formatters > 0 then
|
||||
return client.name == "null-ls"
|
||||
elseif client.supports_method "textDocument/formatting" then
|
||||
elseif client.supports_method("textDocument/formatting") then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
vim.cmd [[
|
||||
vim.cmd([[
|
||||
augroup _lsp
|
||||
autocmd!
|
||||
" autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms =200, filter=format_filter}
|
||||
autocmd BufWritePre * lua vim.lsp.buf.format{filter=format_filter}
|
||||
autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms=1000 ,filter=format_filter}
|
||||
augroup end
|
||||
]]
|
||||
]])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue