Bugfix: window path, !=, ~= for lhs

neovim_0_5
ray-x 3 years ago
parent 4ad8fa3e95
commit 8b84a0e3aa

@ -46,7 +46,9 @@ table.insert(path, "lua/?/init.lua")
local function add(lib)
for _, p in pairs(vim.fn.expand(lib, false, true)) do
p = vim.loop.fs_realpath(p)
library[p] = true
if p then
library[p] = true
end
end
end
@ -54,10 +56,8 @@ end
add("$VIMRUNTIME")
-- add your config
local home = vim.fn.expand("$HOME")
if vim.fn.isdirectory(home .. "/.config/nvim") then
add(home .. "/.config/nvim")
end
-- local home = vim.fn.expand("$HOME")
add(vim.fn.stdpath('config'))
-- add plugins it may be very slow to add all in path
-- if vim.fn.isdirectory(home .. "/.config/share/nvim/site/pack/packer") then
@ -368,7 +368,9 @@ local function setup(user_opts)
local slua = lsp_opts.sumneko_lua
if slua and not slua.cmd then
if slua.sumneko_root_path and slua.sumneko_binary then
lsp_opts.sumneko_lua.cmd = {slua.sumneko_binary, "-E", slua.sumneko_root_path .. "/main.lua"}
lsp_opts.sumneko_lua.cmd = {
slua.sumneko_binary, "-E", slua.sumneko_root_path .. "/main.lua"
}
else
lsp_opts.sumneko_lua.cmd = {"lua-language-server"}
end

@ -28,12 +28,22 @@ local function check_lhs(text, symbol)
local s = find(text, symbol)
local eq = string.find(text, '=') or 0
local eq2 = string.find(text, '==') or 0
local eq3 = string.find(text, '!=') or 0
local eq4 = string.find(text, '~=') or 0
if not s or not eq then
return false
end
if s < eq and eq ~= eq2 then
log(symbol, "modified")
end
if eq == eq3 + 1 then
return false
end
if eq == eq4 + 1 then
return false
end
return s < eq and eq ~= eq2
end

Loading…
Cancel
Save