From 1f8bf765519f3245fd646046f593ffd8ac215061 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 19 May 2016 20:34:48 -0700 Subject: linenoise: support inclusive selection. * linenoise/linenoise.c (struct lino_state): New mode flag, selinclusive. (lino_set_selinclusive, lino_get_selinclusive): New functions. (sync_data_to_buf): Adjust rightmost endpoint when selection is reversed and inclusive mode is in effect, so that the included character will be visually highlighted. (yank_sel, delete_sel): Adjust endpoint of selection if in in inclusive mode. * linenoise/linenoise.h (lino_set_selinclusive, lino_get_selinclusive): Declared. --- linenoise/linenoise.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linenoise/linenoise.h') diff --git a/linenoise/linenoise.h b/linenoise/linenoise.h index afe99c82..f6b692e5 100644 --- a/linenoise/linenoise.h +++ b/linenoise/linenoise.h @@ -72,6 +72,8 @@ int lino_hist_load(lino_t *, const char *filename); int lino_clear_screen(lino_t *); void lino_set_multiline(lino_t *, int ml); int lino_get_multiline(lino_t *); +void lino_set_selinclusive(lino_t *, int si); +int lino_get_selinculsive(lino_t *); typedef char *lino_atom_cb_t(lino_t *, const char *line, int n, void *ctx); void lino_set_atom_cb(lino_t *, lino_atom_cb_t *, void *ctx); -- cgit v1.2.3