Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
14529:957961c9ff99 | 14530:60e0022e6e5d |
---|---|
318 ea.addr_type = ADDR_LINES; | 318 ea.addr_type = ADDR_LINES; |
319 curwin->w_cursor = is_state->search_start; | 319 curwin->w_cursor = is_state->search_start; |
320 parse_cmd_address(&ea, &dummy); | 320 parse_cmd_address(&ea, &dummy); |
321 if (ea.addr_count > 0) | 321 if (ea.addr_count > 0) |
322 { | 322 { |
323 search_first_line = ea.line1; | 323 // Allow for reverse match. |
324 search_last_line = ea.line2; | 324 if (ea.line2 < ea.line1) |
325 { | |
326 search_first_line = ea.line2; | |
327 search_last_line = ea.line1; | |
328 } | |
329 else | |
330 { | |
331 search_first_line = ea.line1; | |
332 search_last_line = ea.line2; | |
333 } | |
325 } | 334 } |
326 else if (*cmd == 's') | 335 else if (*cmd == 's') |
327 { | 336 { |
328 // :s defaults to the current line | 337 // :s defaults to the current line |
329 search_first_line = curwin->w_cursor.lnum; | 338 search_first_line = curwin->w_cursor.lnum; |