Fix pasting into command line

pull/5/head
Iron-E 4 years ago
parent b976bf06e0
commit 66483babc9
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22

@ -4,7 +4,8 @@
*/ */
--]] --]]
local api = vim.api local api = {}
local vim_api = vim.api
------------------------ ------------------------
--[[ SUMMARY: --[[ SUMMARY:
@ -12,7 +13,7 @@ local api = vim.api
]] ]]
------------------------ ------------------------
function api.nvim_bell() function api.nvim_bell()
api.nvim_command('normal ' .. string.char(27)) -- escape char vim_api.nvim_command('normal '..string.char(27)) -- escape char
end end
------------------------------------ ------------------------------------
@ -25,7 +26,7 @@ end
]] ]]
------------------------------------ ------------------------------------
function api.nvim_exists(scope, var) function api.nvim_exists(scope, var)
return api.nvim_call_function('exists', {scope .. ':' .. var}) == require('libmodal/src/globals').VIM_TRUE return vim_api.nvim_call_function('exists', {scope..':'..var}) == require('libmodal/src/globals').VIM_TRUE
end end
------------------------- -------------------------
@ -53,7 +54,17 @@ end
]] ]]
------------------------- -------------------------
function api.nvim_input() function api.nvim_input()
return api.nvim_call_function('getchar', {}) return vim_api.nvim_call_function('getchar', {})
end
--------------------------
--[[ SUMMARY:
* Run `mode` to refresh the screen.
* The function was not named `nvim_mode` because that would be really confusing given the name of this plugin.
]]
--------------------------
function api.nvim_redraw()
vim_api.nvim_command('mode')
end end
--------------------------------- ---------------------------------
@ -79,19 +90,9 @@ function api.nvim_lecho(hlTables)
lecho_template[2] = tostring(hlTable.hl) lecho_template[2] = tostring(hlTable.hl)
lecho_template[4] = tostring(hlTable.str) lecho_template[4] = tostring(hlTable.str)
api.nvim_command(table.concat(lecho_template)) vim_api.nvim_command(table.concat(lecho_template))
end end
api.nvim_command('echohl None') vim_api.nvim_command('echohl None')
end
--------------------------
--[[ SUMMARY:
* Run `mode` to refresh the screen.
* The function was not named `nvim_mode` because that would be really confusing given the name of this plugin.
]]
--------------------------
function api.nvim_redraw()
api.nvim_command('mode')
end end
-------------------------------------- --------------------------------------
@ -107,10 +108,10 @@ end
function api.nvim_show_err(title, msg) function api.nvim_show_err(title, msg)
local HighlightSegment = require('libmodal/src/Indicator/HighlightSegment') local HighlightSegment = require('libmodal/src/Indicator/HighlightSegment')
api.nvim_lecho({ api.nvim_lecho({
HighlightSegment.new('Title', tostring(title) .. '\n'), HighlightSegment.new('Title', tostring(title)..'\n'),
HighlightSegment.new('Error', tostring(msg)), HighlightSegment.new('Error', tostring(msg)),
}) })
api.nvim_call_function('getchar', {}) vim_api.nvim_call_function('getchar', {})
end end
--[[ --[[

Loading…
Cancel
Save