changed_callback allows to execute arbitrary code any time the
command string changes.
keypressed_callback allows to intercept keypresses before
awful.prompt.run code handles them and run arbitrary code depending on
the key pressed and modificators.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Returning true from the callback to `keygrabber` is no longer necessary to
continue grabbing the keyboard.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This was broken since 014d191f66 (which made this kind of stuff mandatory,
because 'return false' is ignored now). Whoops.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:
#!/bin/ksh
git ls-tree -r HEAD | cut -f2 | while read f; do
egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
mv /tmp/foo $f
done
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
If set the prompt will execute the command upon completion which returns
only one match.
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
If you entered a multi-byte character into a prompt and then changed your mind
and used backspace to fix the character, only the last byte of the character was
removed. Because pango is intelligent, it noticed the broken utf8 and
complained.
So far nothing new. But since 711d78b50c the textbox will throw a lua error
when it gets an invalid text (= pango complains). Throwing an unprotected lua
error in this context causes the keygrabber to be killed which stops the prompt.
Fix this by removing bytes as long as there are bytes left that can be removed.
This is FS#801.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Also changes prompt_text_with_cursor() to take a table instead of
list of arguments allowing to incorporate font setting and
'prettyprompt' settings into the function.
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
selectall argument to run():
* renders cursor selection
* is reset when anything but typing occurs
* is now independent from cur_pos == 1
Signed-off-by: koniu <gkusnierz@gmail.com>
Adds a trailing space after text if cursor position < text length to
prevent width of the widget changing particularly useful when using
'text' and 'selectall' to do eg. in-place renaming.
Sample textbox content (# space, _ cursor).
Before:
textbox before prompt: #term#
selectall prompt textbox : #_erm <- shorter than other cases
after pressing end : #term_
After:
textbox before prompt: #term#
selectall prompt textbox : #_erm#
after pressing end : #term_
Signed-off-by: koniu <gkusnierz@gmail.com>
If set along with 'text' (prefilled content) it will position the cursor at
the beginning of the line and and on text input (and not control keys,
arrows, etc.) will overwrite the prefilled content with the new input.
Signed-off-by: koniu <gkusnierz@gmail.com>