From f9869d6a3729dcba967fcf6a317b075ebc43bd6e Mon Sep 17 00:00:00 2001 From: Iron-E Date: Sun, 17 May 2020 17:07:53 -0400 Subject: [PATCH] Remove unnecessary print statements --- autoload/libmodal.vim.orig | 90 ++++++++++++++++++++++++++++++++++ lua/libmodal/src/mode/init.lua | 5 -- 2 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 autoload/libmodal.vim.orig diff --git a/autoload/libmodal.vim.orig b/autoload/libmodal.vim.orig new file mode 100644 index 0000000..e917c84 --- /dev/null +++ b/autoload/libmodal.vim.orig @@ -0,0 +1,90 @@ +" SUMMARY: +" * Get user input with some `completions`. +" PARAMS: +" * `indicator` => the prompt string. +" * `completions` => the list of completions to provide. +" RETURNS: +" * Input from `input()`. +function! libmodal#_inputWith(indicator, completions) + " TODO: 0.5 — return input(a:indicator, '', 'customlist,v:lua.require("libmodal/src/prompt")…') + " return the closure that was generated using the completions from lua. + function! LibmodalCompletionsProvider(argLead, cmdLine, cursorPos) abort closure + return luaeval( + \ 'require("libmodal/src/prompt/")._createCompletionsProvider(_A[1])(_A[2], _A[3], _A[4])', + \ [a:completions, a:argLead, a:cmdLine, a:cursorPos] + \) + endfunction + + echohl LibmodalStar + return input(a:indicator, '', 'customlist,LibmodalCompletionsProvider') +endfunction +<<<<<<< HEAD + +" SUMMARY: +" * Open a floating window using native vimscript. +" REMARKS: +" * There are bugs with creating floating windows using Lua (mostly they are +" always focused), so it was necessary to create a vimscript method. +" PARAMS: +" * `bufHandle` => the buffer to spawn the window for. +" RETURNS: +" * A window handle. +function! libmodal#_winOpen(bufHandle) abort + return nvim_open_win(a:bufHandle, 0, s:winOpenOpts) +endfunction + +" SUMMARY: +" * Runs the nvim-libmodal command prompt loop. The function takes an optional +" argument specifying how many times to run (runs until exiting by default). +" PARAMS: +" * `a:1` => `modeName` +" * `a:2` => `modeCallback` OR `modeCombos` +" * `a:3` => `supressExit` +function! libmodal#Enter(...) abort + call libmodal#_lua('mode', a:000) +endfunction + +" SUMMARY: +" * Runs the nvim-libmodal command prompt loop. The function takes an optional +" argument specifying how many times to run (runs until exiting by default). +" PARAMS: +" * `a:1` => `modeName` +" * `a:2` => `modeCallback` OR `modeCommands` +" * `a:3` => `modeCompletions` +function! libmodal#Prompt(...) abort + call libmodal#_lua('path', a:000) +endfunction + +" SUMMARY: +" * Pass arguments to an nvim-libmodal `enter()` command at the specified +" `lib` path. +" PARAMS: +" * `lib` => the name of the library. +" * 'mode" or 'prompt'. +" * `args` => the arguments to pass to `lib`.enter() +function! libmodal#_lua(lib, args) + call luaeval( + \ 'require("libmodal/src/' . a:lib . '").enter(_A[1], _A[2], _A[3])', + \ [ + \ a:args[0], + \ a:args[1], + \ len(a:args) > 2 ? a:args[2] : v:false + \ ] + \) +endfunction +||||||| parent of 89bc16f... Remove all unneeded references to api.nvim + +" SUMMARY: +" * Open a floating window using native vimscript. +" REMARKS: +" * There are bugs with creating floating windows using Lua (mostly they are +" always focused), so it was necessary to create a vimscript method. +" PARAMS: +" * `bufHandle` => the buffer to spawn the window for. +" RETURNS: +" * A window handle. +function! libmodal#_winOpen(bufHandle) abort + return nvim_open_win(a:bufHandle, 0, s:winOpenOpts) +endfunction +======= +>>>>>>> 89bc16f... Remove all unneeded references to api.nvim diff --git a/lua/libmodal/src/mode/init.lua b/lua/libmodal/src/mode/init.lua index eb1075e..54d03cb 100644 --- a/lua/libmodal/src/mode/init.lua +++ b/lua/libmodal/src/mode/init.lua @@ -205,8 +205,6 @@ end -------------------------------------------------------------------------------- local function _modeLoop(handleExitEvents, indicator, modeInstruction, modeName) -- If the mode is not handling exit events automatically and the global exit var is true. - print(type(modeInstruction)) - print(modeInstruction) if not handleExitEvents and globals.isTrue( vars.nvim_get(vars.exit, modeName) ) then return false end @@ -249,9 +247,6 @@ end ------------------------ function mode.enter(...) local args = {...} - print(args[1]) - print(args[2]) - print(args[3]) --[[ SETUP. ]]