diff options
author | nicm <nicm> | 2019-10-23 07:42:05 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-10-23 07:42:05 +0000 |
commit | f7fb5df54312fb4d7421ba7b25fa00987085ac65 (patch) | |
tree | 6f6de3418cbcb46be4d0d4b021005295e16a5cfb /window-copy.c | |
parent | 56e5067c462a8c03fd35fbd5833c5fe17c23b0fa (diff) |
Use the existing code in format.c to add foramts for word and line at
cursor position in copy mode, from Anindya Mukherjee.
Diffstat (limited to 'window-copy.c')
-rw-r--r-- | window-copy.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/window-copy.c b/window-copy.c index bca236e3..473112e3 100644 --- a/window-copy.c +++ b/window-copy.c @@ -564,6 +564,7 @@ static void window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft) { struct window_copy_mode_data *data = wme->data; + char *s; format_add(ft, "scroll_position", "%d", data->oy); format_add(ft, "rectangle_toggle", "%d", data->rectflag); @@ -578,6 +579,18 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft) format_add(ft, "selection_end_x", "%d", data->endselx); format_add(ft, "selection_end_y", "%d", data->endsely); } + + s = format_grid_word(data->screen.grid, data->cx, data->cy); + if (s != NULL) { + format_add(ft, "copy_cursor_word", "%s", s); + free(s); + } + + s = format_grid_line(data->screen.grid, data->cy); + if (s != NULL) { + format_add(ft, "copy_cursor_line", "%s", s); + free(s); + } } static void |