mirror of
https://github.com/troglobit/editline.git
synced 2025-09-19 11:28:09 +08:00
Add support for el_bind_key() and example usage binding '?' in examples/cli.c
This changeset refactors el_bind_key_in_metamap() into two functions, adding el_bind_key(), to provide the ability for the user to bind keys in both the regular and the meta-key maps. Several useful, but previously internal, functions have been made global to facilitate the example code mentioned above. These are likely useful to the user of this library as well: el_print_columns() - Display words in columns across a tty_cols wide screen. el_ring_bell() - Can be used as default key binding function. el_find_word() - Returns a copy of the word at rl_point.
This commit is contained in:
@@ -56,6 +56,9 @@
|
||||
#define MEM_INC 64
|
||||
#define SCREEN_INC 256
|
||||
|
||||
/* http://stackoverflow.com/questions/1598773/is-there-a-standard-function-in-c-that-would-return-the-length-of-an-array/1598827#1598827 */
|
||||
#define ARRAY_ELEMENTS(arr) ((sizeof(arr)/sizeof(0[arr])) / ((size_t)(!(sizeof(arr) % sizeof(0[arr])))))
|
||||
|
||||
/*
|
||||
** Variables and routines internal to this package.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user