From 88419625268cce03b606584624b731ba10e37f21 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 15 Apr 2013 19:26:43 -0400 Subject: Function in `finish_mode()` is optional; modules/textadept/command_entry.lua --- modules/textadept/command_entry.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/textadept/command_entry.lua') diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index 005af837..c3dfd963 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -61,16 +61,16 @@ end --- -- Exits the current key mode, closes the command entry, and calls function *f* --- with the command entry text as an argument. +-- (if given) with the command entry text as an argument. -- This is useful for binding keys to exit a command entry mode and perform an -- action with the entered text. --- @param f The function to call. It should accept the command entry text as an --- argument. +-- @param f Optional function to call. It should accept the command entry text +-- as an argument. -- @usage keys['\n'] = {gui.command_entry.finish_mode, gui.print} -- @name finish_mode function M.finish_mode(f) M.enter_mode(nil) - f(M.entry_text) + if f then f(M.entry_text) end if CURSES then return false end -- propagate to exit CDK entry on Enter end -- cgit v1.2.3