summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1247
diff options
context:
space:
mode:
Diffstat (limited to 'data/vim/patches/8.1.1247')
-rw-r--r--data/vim/patches/8.1.1247373
1 files changed, 373 insertions, 0 deletions
diff --git a/data/vim/patches/8.1.1247 b/data/vim/patches/8.1.1247
new file mode 100644
index 000000000..eceb1b35e
--- /dev/null
+++ b/data/vim/patches/8.1.1247
@@ -0,0 +1,373 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 8.1.1247
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 8.1.1247
+Problem: Urxvt mouse codes are not tested.
+Solution: Also set 'ttymouse' to "urxvt" in the termcodes test.
+Files: src/testdir/test_termcodes.vim
+
+
+*** ../vim-8.1.1246/src/testdir/test_termcodes.vim 2019-05-01 23:13:53.270968846 +0200
+--- src/testdir/test_termcodes.vim 2019-05-02 21:09:32.053517694 +0200
+***************
+*** 7,17 ****
+
+ source shared.vim
+
+ " Helper function to emit a terminal escape code.
+! func TerminalEscapeCode(code_xterm, code_sgr, row, col, m)
+ if &ttymouse ==# 'xterm2'
+ " need to use byte encoding here.
+! let str = list2str([a:code_xterm, a:col + 0x20, a:row + 0x20])
+ if has('iconv')
+ let bytes = iconv(str, 'utf-8', 'latin1')
+ else
+--- 7,23 ----
+
+ source shared.vim
+
++ " xterm2 and sgr always work, urxvt is optional.
++ let s:test_ttymouse = ['xterm2', 'sgr']
++ if has('mouse_urxvt')
++ call add(s:test_ttymouse, 'urxvt')
++ endif
++
+ " Helper function to emit a terminal escape code.
+! func TerminalEscapeCode(code, row, col, m)
+ if &ttymouse ==# 'xterm2'
+ " need to use byte encoding here.
+! let str = list2str([a:code + 0x20, a:col + 0x20, a:row + 0x20])
+ if has('iconv')
+ let bytes = iconv(str, 'utf-8', 'latin1')
+ else
+***************
+*** 20,69 ****
+ endif
+ call feedkeys("\<Esc>[M" .. bytes, 'Lx!')
+ elseif &ttymouse ==# 'sgr'
+! call feedkeys(printf("\<Esc>[<%d;%d;%d%s", a:code_sgr, a:col, a:row, a:m), 'Lx!')
+ endif
+ endfunc
+
+ func MouseLeftClick(row, col)
+! call TerminalEscapeCode(0x20, 0, a:row, a:col, 'M')
+ endfunc
+
+ func MouseMiddleClick(row, col)
+! call TerminalEscapeCode(0x21, 1, a:row, a:col, 'M')
+ endfunc
+
+ func MouseCtrlLeftClick(row, col)
+ let ctrl = 0x10
+! call TerminalEscapeCode(0x20 + ctrl, 0 + ctrl, a:row, a:col, 'M')
+ endfunc
+
+ func MouseCtrlRightClick(row, col)
+ let ctrl = 0x10
+! call TerminalEscapeCode(0x22 + ctrl, 2 + ctrl, a:row, a:col, 'M')
+ endfunc
+
+ func MouseLeftRelease(row, col)
+! call TerminalEscapeCode(0x23, 3, a:row, a:col, 'm')
+ endfunc
+
+ func MouseMiddleRelease(row, col)
+! call TerminalEscapeCode(0x23, 3, a:row, a:col, 'm')
+ endfunc
+
+ func MouseRightRelease(row, col)
+! call TerminalEscapeCode(0x23, 3, a:row, a:col, 'm')
+ endfunc
+
+ func MouseLeftDrag(row, col)
+! call TerminalEscapeCode(0x43, 0x20, a:row, a:col, 'M')
+ endfunc
+
+ func MouseWheelUp(row, col)
+! call TerminalEscapeCode(0x40, 0x40, a:row, a:col, 'M')
+ endfunc
+
+ func MouseWheelDown(row, col)
+! call TerminalEscapeCode(0x41, 0x41, a:row, a:col, 'M')
+ endfunc
+
+ func Test_xterm_mouse_left_click()
+--- 26,77 ----
+ endif
+ call feedkeys("\<Esc>[M" .. bytes, 'Lx!')
+ elseif &ttymouse ==# 'sgr'
+! call feedkeys(printf("\<Esc>[<%d;%d;%d%s", a:code, a:col, a:row, a:m), 'Lx!')
+! elseif &ttymouse ==# 'urxvt'
+! call feedkeys(printf("\<Esc>[%d;%d;%dM", a:code + 0x20, a:col, a:row), 'Lx!')
+ endif
+ endfunc
+
+ func MouseLeftClick(row, col)
+! call TerminalEscapeCode(0, a:row, a:col, 'M')
+ endfunc
+
+ func MouseMiddleClick(row, col)
+! call TerminalEscapeCode(1, a:row, a:col, 'M')
+ endfunc
+
+ func MouseCtrlLeftClick(row, col)
+ let ctrl = 0x10
+! call TerminalEscapeCode(0 + ctrl, a:row, a:col, 'M')
+ endfunc
+
+ func MouseCtrlRightClick(row, col)
+ let ctrl = 0x10
+! call TerminalEscapeCode(2 + ctrl, a:row, a:col, 'M')
+ endfunc
+
+ func MouseLeftRelease(row, col)
+! call TerminalEscapeCode(3, a:row, a:col, 'm')
+ endfunc
+
+ func MouseMiddleRelease(row, col)
+! call TerminalEscapeCode(3, a:row, a:col, 'm')
+ endfunc
+
+ func MouseRightRelease(row, col)
+! call TerminalEscapeCode(3, a:row, a:col, 'm')
+ endfunc
+
+ func MouseLeftDrag(row, col)
+! call TerminalEscapeCode(0x20, a:row, a:col, 'M')
+ endfunc
+
+ func MouseWheelUp(row, col)
+! call TerminalEscapeCode(0x40, a:row, a:col, 'M')
+ endfunc
+
+ func MouseWheelDown(row, col)
+! call TerminalEscapeCode(0x41, a:row, a:col, 'M')
+ endfunc
+
+ func Test_xterm_mouse_left_click()
+***************
+*** 74,80 ****
+ set mouse=a term=xterm
+ call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ go
+--- 82,88 ----
+ set mouse=a term=xterm
+ call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ go
+***************
+*** 99,105 ****
+ let save_ttymouse = &ttymouse
+ set mouse=a term=xterm
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ help
+--- 107,113 ----
+ let save_ttymouse = &ttymouse
+ set mouse=a term=xterm
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ help
+***************
+*** 138,144 ****
+ let @* = 'abc'
+ set mouse=a term=xterm
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ call setline(1, ['123456789', '123456789'])
+--- 146,152 ----
+ let @* = 'abc'
+ set mouse=a term=xterm
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ call setline(1, ['123456789', '123456789'])
+***************
+*** 179,185 ****
+ set mouse=a term=xterm
+ call setline(1, range(1, 100))
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ go
+--- 187,193 ----
+ set mouse=a term=xterm
+ call setline(1, range(1, 100))
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ go
+***************
+*** 215,221 ****
+ let save_ttymouse = &ttymouse
+ set mouse=a term=xterm
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+
+--- 223,229 ----
+ let save_ttymouse = &ttymouse
+ set mouse=a term=xterm
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+
+***************
+*** 272,278 ****
+ let save_laststatus = &laststatus
+ set mouse=a term=xterm laststatus=2
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+
+--- 280,286 ----
+ let save_laststatus = &laststatus
+ set mouse=a term=xterm laststatus=2
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+
+***************
+*** 313,319 ****
+ set mouse=a term=xterm
+ let row = 1
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ e Xfoo
+--- 321,327 ----
+ set mouse=a term=xterm
+ let row = 1
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ e Xfoo
+***************
+*** 361,367 ****
+ let row = 1
+ let col = &columns
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ if ttymouse_val ==# 'xterm2' && col > 223
+ " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
+ continue
+--- 369,375 ----
+ let row = 1
+ let col = &columns
+
+! for ttymouse_val in s:test_ttymouse
+ if ttymouse_val ==# 'xterm2' && col > 223
+ " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
+ continue
+***************
+*** 407,413 ****
+ set mouse=a term=xterm mousetime=1
+ let row = 1
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ e Xtab1
+--- 415,421 ----
+ set mouse=a term=xterm mousetime=1
+ let row = 1
+
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ e Xtab1
+***************
+*** 456,467 ****
+ let row = 1
+ let col = 10
+
+! for ttymouse_val in ['xterm2', 'sgr']
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ e Xtab1
+ tabnew Xtab2
+
+ let a = split(execute(':tabs'), "\n")
+ call assert_equal(['Tab page 1',
+ \ ' Xtab1',
+--- 464,483 ----
+ let row = 1
+ let col = 10
+
+! let round = 0
+! for ttymouse_val in s:test_ttymouse
+ let msg = 'ttymouse=' .. ttymouse_val
+ exe 'set ttymouse=' .. ttymouse_val
+ e Xtab1
+ tabnew Xtab2
+
++ if round > 0
++ " We need to sleep, or else the first MouseLeftClick() will be
++ " interpreted as a spurious triple-click.
++ sleep 100m
++ endif
++ let round += 1
++
+ let a = split(execute(':tabs'), "\n")
+ call assert_equal(['Tab page 1',
+ \ ' Xtab1',
+***************
+*** 485,495 ****
+ \ 'Tab page 3',
+ \ ' Xtab2'], a, msg)
+
+- if ttymouse_val !=# 'sgr'
+- " We need to sleep, or else MouseLeftClick() in next loop
+- " iteration will be interpreted as a spurious triple-click.
+- sleep 100m
+- endif
+ %bwipe!
+ endfor
+
+--- 501,506 ----
+*** ../vim-8.1.1246/src/version.c 2019-05-02 20:24:08.624617859 +0200
+--- src/version.c 2019-05-02 21:11:40.708817159 +0200
+***************
+*** 769,770 ****
+--- 769,772 ----
+ { /* Add new patch number below this line */
++ /**/
++ 1247,
+ /**/
+
+--
+Vi beats Emacs to death, and then again!
+ http://linuxtoday.com/stories/5764.html
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///