From dd3a6e2d9487c970fd007989833fc68a3261183a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 1 Aug 2015 19:46:48 +0200 Subject: vis: add motions [[, [], ][, ]] They behave not like in vim, but instead try to find the start/end of C-like function definitions. The first character stands for the direction [ for backwards, ] for forwards. The second character denotes the start [ or end ] respectively. --- text-motions.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'text-motions.h') diff --git a/text-motions.h b/text-motions.h index c89c256..ce3c5d5 100644 --- a/text-motions.h +++ b/text-motions.h @@ -43,6 +43,9 @@ size_t text_line_char_set(Text*, size_t pos, int count); /* move to the next/previous character on the same line */ size_t text_line_char_next(Text*, size_t pos); size_t text_line_char_prev(Text*, size_t pos); +/* move to the next/previous empty line */ +size_t text_line_empty_next(Text*, size_t pos); +size_t text_line_empty_prev(Text*, size_t pos); /* move to same offset in previous/next line */ size_t text_line_up(Text*, size_t pos); size_t text_line_down(Text*, size_t pos); @@ -86,6 +89,11 @@ size_t text_sentence_prev(Text*, size_t pos); */ size_t text_paragraph_next(Text*, size_t pos); size_t text_paragraph_prev(Text*, size_t pos); +/* Find next/previous start/end of a C like function definition */ +size_t text_function_start_next(Text*, size_t pos); +size_t text_function_start_prev(Text*, size_t pos); +size_t text_function_end_next(Text*, size_t pos); +size_t text_function_end_prev(Text*, size_t pos); /* A section begins after a form-feed in the first column. size_t text_section_next(Text*, size_t pos); size_t text_section_prev(Text*, size_t pos); -- cgit v1.2.3