InsertMode is required
This commit is contained in:
@@ -192,10 +192,7 @@ Default:
|
|||||||
|
|
||||||
```lua
|
```lua
|
||||||
function()
|
function()
|
||||||
local enabled = true
|
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
||||||
enabled = enabled and vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
|
||||||
enabled = enabled and string.sub(vim.api.nvim_get_mode().mode, 1, 1) == 'i'
|
|
||||||
return enabled
|
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ end
|
|||||||
config.enabled = function()
|
config.enabled = function()
|
||||||
local enabled = config.get().enabled
|
local enabled = config.get().enabled
|
||||||
if type(enabled) == 'function' then
|
if type(enabled) == 'function' then
|
||||||
return enabled()
|
enabled = enabled()
|
||||||
end
|
end
|
||||||
return not not enabled
|
return enabled and string.sub(vim.api.nvim_get_mode().mode, 1, 1) == 'i'
|
||||||
end
|
end
|
||||||
|
|
||||||
---Return source config
|
---Return source config
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ local WIDE_HEIGHT = 40
|
|||||||
return function()
|
return function()
|
||||||
return {
|
return {
|
||||||
enabled = function()
|
enabled = function()
|
||||||
local enabled = true
|
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
||||||
enabled = enabled and vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
|
||||||
enabled = enabled and string.sub(vim.api.nvim_get_mode().mode, 1, 1) == 'i'
|
|
||||||
return enabled
|
|
||||||
end,
|
end,
|
||||||
completion = {
|
completion = {
|
||||||
autocomplete = {
|
autocomplete = {
|
||||||
|
|||||||
Reference in New Issue
Block a user