Mercurial > vim
comparison src/testdir/test_listener.vim @ 16774:0cc3f459237b v8.1.1389
patch 8.1.1389: changes are not flushed when end and start overlap
commit https://github.com/vim/vim/commit/7b31a181c84ec6b9050892e80f3132907569f8d8
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 24 21:39:27 2019 +0200
patch 8.1.1389: changes are not flushed when end and start overlap
Problem: Changes are not flushed when end and start overlap. (Paul Jolly)
Solution: When end of a previous changes overlaps with start of a new
change, first flush listeners.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 May 2019 21:45:05 +0200 |
parents | 978bcd70883d |
children | 5493e31010e1 |
comparison
equal
deleted
inserted
replaced
16773:cb22e7579bd7 | 16774:0cc3f459237b |
---|---|
185 call assert_equal(1, s:added) | 185 call assert_equal(1, s:added) |
186 call assert_equal([{'lnum': 3, 'end': 3, 'col': 1, 'added': 1}, | 186 call assert_equal([{'lnum': 3, 'end': 3, 'col': 1, 'added': 1}, |
187 \ {'lnum': 4, 'end': 5, 'col': 1, 'added': -1}, | 187 \ {'lnum': 4, 'end': 5, 'col': 1, 'added': -1}, |
188 \ {'lnum': 6, 'end': 6, 'col': 1, 'added': 1}], s:list) | 188 \ {'lnum': 6, 'end': 6, 'col': 1, 'added': 1}], s:list) |
189 | 189 |
190 " split a line then insert one, should get two disconnected change lists | |
191 call setline(1, 'split here') | |
192 call listener_flush() | |
193 let s:list = [] | |
194 exe "normal 1ggwi\<CR>\<Esc>" | |
195 1 | |
196 normal o | |
197 call assert_equal([{'lnum': 1, 'end': 2, 'col': 7, 'added': 1}], s:list) | |
198 call listener_flush() | |
199 call assert_equal([{'lnum': 2, 'end': 2, 'col': 1, 'added': 1}], s:list) | |
200 | |
190 call listener_remove(id) | 201 call listener_remove(id) |
191 bwipe! | 202 bwipe! |
192 endfunc | 203 endfunc |
193 | 204 |
194 func s:StoreBufList(buf, start, end, added, list) | 205 func s:StoreBufList(buf, start, end, added, list) |