diff options
author | Anatolii Sakhnik <sakhnik@gmail.com> | 2018-12-09 15:00:19 +0200 |
---|---|---|
committer | Anatolii Sakhnik <sakhnik@gmail.com> | 2018-12-09 19:45:56 +0200 |
commit | 972ad1119557a0f72f1907c6758d6ed56438e5b3 (patch) | |
tree | 34af8981e961aa874d68ad918eb02d1ec1f3a068 /test/functional/ui/diff_spec.lua | |
parent | 72c5a9db70f263eaac12aee140da03190e2fa605 (diff) | |
download | rneovim-972ad1119557a0f72f1907c6758d6ed56438e5b3.tar.gz rneovim-972ad1119557a0f72f1907c6758d6ed56438e5b3.tar.bz2 rneovim-972ad1119557a0f72f1907c6758d6ed56438e5b3.zip |
vim-patch:8.1.0393: not all white space difference options available
Problem: Not all white space difference options available.
Solution: Add "iblank", "iwhiteall" and "iwhiteeol" to 'diffopt'.
https://github.com/vim/vim/commit/785fc6567f572b8caefbc89ec29bbd8b801464ae
Diffstat (limited to 'test/functional/ui/diff_spec.lua')
-rw-r--r-- | test/functional/ui/diff_spec.lua | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua index 8f2b667b3c..4d81d85553 100644 --- a/test/functional/ui/diff_spec.lua +++ b/test/functional/ui/diff_spec.lua @@ -773,4 +773,163 @@ int main(int argc, char **argv) ]]) end) end) + + describe('diffopt+=iblank', function() + setup(function() + write_file(fname, 'a\n\n \ncd\nef\nxxx\n', false) + write_file(fname_2, 'a\ncd\n\nef\nyyy\n', false) + feed(':diffupdate!<cr>') + end) + + it('generic', function() + reread() + feed(':set diffopt=internal,filler,iblank<cr>') + screen:expect([[ + {1: }^a {3:│}{1: }a | + {1: }{4: }{3:│}{1: }{2:-----------------}| + {1: }{4: }{3:│}{1: }{2:-----------------}| + {1: }cd {3:│}{1: }cd | + {1: }ef {3:│}{1: } | + {1: }{8:xxx}{9: }{3:│}{1: }ef | + {1: }{6:~ }{3:│}{1: }{8:yyy}{9: }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }| + :set diffopt=internal,filler,iblank | + ]]) + end) + + it('diffopt+=iwhite', function() + reread() + feed(':set diffopt=internal,filler,iblank,iwhite<cr>') + feed(':<cr>') + screen:expect([[ + {1: }^a {3:│}{1: }a | + {1: } {3:│}{1: }cd | + {1: } {3:│}{1: } | + {1: }cd {3:│}{1: }ef | + {1: }ef {3:│}{1: }{8:yyy}{9: }| + {1: }{8:xxx}{9: }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }| + : | + ]]) + end) + + it('diffopt+=iwhiteall', function() + reread() + feed(':set diffopt=internal,filler,iblank,iwhiteall<cr>') + feed(':<cr>') + screen:expect([[ + {1: }^a {3:│}{1: }a | + {1: } {3:│}{1: }cd | + {1: } {3:│}{1: } | + {1: }cd {3:│}{1: }ef | + {1: }ef {3:│}{1: }{8:yyy}{9: }| + {1: }{8:xxx}{9: }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }| + : | + ]]) + end) + + it('diffopt+=iwhiteeol', function() + reread() + feed(':set diffopt=internal,filler,iblank,iwhiteeol<cr>') + feed(':<cr>') + screen:expect([[ + {1: }^a {3:│}{1: }a | + {1: } {3:│}{1: }cd | + {1: } {3:│}{1: } | + {1: }cd {3:│}{1: }ef | + {1: }ef {3:│}{1: }{8:yyy}{9: }| + {1: }{8:xxx}{9: }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }| + : | + ]]) + end) + end) + + describe('diffopt+=iwhite{eol,all}', function() + setup(function() + write_file(fname, 'a \nx\ncd\nef\nxx xx\nfoo\nbar\n', false) + write_file(fname_2, 'a\nx\nc d\n ef\nxx xx\nfoo\n\nbar\n', false) + feed(':diffupdate!<cr>') + end) + + it('diffopt+=iwhiteeol', function() + reread() + feed(':set diffopt=internal,filler,iwhiteeol<cr>') + feed(':<cr>') + screen:expect([[ + {1: }^a {3:│}{1: }a | + {1: }x {3:│}{1: }x | + {1: }{9:cd }{3:│}{1: }{9:c}{8: }{9:d }| + {1: }{9:ef }{3:│}{1: }{8: }{9:ef }| + {1: }{9:xx }{8: }{9:xx }{3:│}{1: }{9:xx xx }| + {1: }foo {3:│}{1: }foo | + {1: }{2:------------------}{3:│}{1: }{4: }| + {1: }bar {3:│}{1: }bar | + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }| + : | + ]]) + end) + + it('diffopt+=iwhiteall', function() + reread() + feed(':set diffopt=internal,filler,iwhiteall<cr>') + feed(':<cr>') + screen:expect([[ + {1: }^a {3:│}{1: }a | + {1: }x {3:│}{1: }x | + {1: }cd {3:│}{1: }c d | + {1: }ef {3:│}{1: } ef | + {1: }xx xx {3:│}{1: }xx xx | + {1: }foo {3:│}{1: }foo | + {1: }{2:------------------}{3:│}{1: }{4: }| + {1: }bar {3:│}{1: }bar | + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {1: }{6:~ }{3:│}{1: }{6:~ }| + {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }| + : | + ]]) + end) + end) end) |