Mercurial > vim
diff src/ex_getln.c @ 14530:60e0022e6e5d v8.1.0278
patch 8.1.0278: 'incsearch' highlighting does not accept reverse range
commit https://github.com/vim/vim/commit/60d0871000e9abf3716ee035cba5b5a9d659e327
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 12 21:53:15 2018 +0200
patch 8.1.0278: 'incsearch' highlighting does not accept reverse range
Problem: 'incsearch' highlighting does not accept reverse range.
Solution: Swap the range when needed. (issue https://github.com/vim/vim/issues/3321)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Aug 2018 22:00:05 +0200 |
parents | 58ca11610819 |
children | 58cc47fae12e |
line wrap: on
line diff
--- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -320,8 +320,17 @@ do_incsearch_highlighting(int firstc, in parse_cmd_address(&ea, &dummy); if (ea.addr_count > 0) { - search_first_line = ea.line1; - search_last_line = ea.line2; + // Allow for reverse match. + if (ea.line2 < ea.line1) + { + search_first_line = ea.line2; + search_last_line = ea.line1; + } + else + { + search_first_line = ea.line1; + search_last_line = ea.line2; + } } else if (*cmd == 's') {