mirror of
https://github.com/vim/vim.git
synced 2025-08-26 20:03:41 -04:00
Add support for horizontal scroll wheel. (Bjorn Winckler)
This commit is contained in:
parent
0fe849a13b
commit
8d9b40e71a
@ -1,4 +1,4 @@
|
|||||||
*if_pyth.txt* For Vim version 7.3b. Last change: 2010 Jul 24
|
*if_pyth.txt* For Vim version 7.3b. Last change: 2010 Jul 25
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Paul Moore
|
VIM REFERENCE MANUAL by Paul Moore
|
||||||
@ -337,12 +337,21 @@ sure edit "gvim.exe" and search for "python\d*.dll\c".
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
7. Python 3 *python3*
|
7. Python 3 *python3*
|
||||||
|
|
||||||
Python 3 support can exist next to Python 2.x.
|
*:py3* *:python3*
|
||||||
|
The |:py3| and |:python3| commands work similar to |:python|.
|
||||||
|
*:py3file*
|
||||||
|
The |:py3file| command works similar to |:pyfile|.
|
||||||
|
|
||||||
*:py3* *:python3* *:py3file*
|
Vim can be built in four ways (:version output):
|
||||||
|
1. No Python support (-python, -python3)
|
||||||
TODO
|
2. Python 2 support only (+python or +python/dyn, -python3)
|
||||||
|
3. Python 3 support only (-python, +python3 or +python3/dyn)
|
||||||
|
4. Python 2 and 3 support (+python/dyn, +python3/dyn)
|
||||||
|
|
||||||
|
You can see that when Python 2 and Python 3 are both supported they must be
|
||||||
|
loaded dynamically. This may cause some problems though, therefore currently
|
||||||
|
inside a Vim executable you can only use Python 2 or Python 3. To switch to
|
||||||
|
the other one you need to restart Vim.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
@ -136,10 +136,14 @@ tag char action ~
|
|||||||
|i_<Help>| <Help> stop insert mode and display help window
|
|i_<Help>| <Help> stop insert mode and display help window
|
||||||
|i_<Insert>| <Insert> toggle Insert/Replace mode
|
|i_<Insert>| <Insert> toggle Insert/Replace mode
|
||||||
|i_<LeftMouse>| <LeftMouse> cursor at mouse click
|
|i_<LeftMouse>| <LeftMouse> cursor at mouse click
|
||||||
|i_<MouseDown>| <MouseDown> scroll three lines downwards
|
|i_<ScrollWheelDown>| <ScrollWheelDown> move window three lines down
|
||||||
|i_<S-MouseDown>| <S-MouseDown> scroll a full page downwards
|
|i_<S-ScrollWheelDown>| <S-ScrollWheelDown> move window one page down
|
||||||
|i_<MouseUp>| <MouseUp> scroll three lines upwards
|
|i_<ScrollWheelUp>| <ScrollWheelUp> move window three lines up
|
||||||
|i_<S-MouseUp>| <S-MouseUp> scroll a full page upwards
|
|i_<S-ScrollWheelUp>| <S-ScrollWheelUp> move window one page up
|
||||||
|
|i_<ScrollWheelLeft>| <ScrollWheelLeft> move window six columns left
|
||||||
|
|i_<S-ScrollWheelLeft>| <S-ScrollWheelLeft> move window one page left
|
||||||
|
|i_<ScrollWheelRight>| <ScrollWheelRight> move window six columns right
|
||||||
|
|i_<S-ScrollWheelRight>| <S-ScrollWheelRight> move window one page right
|
||||||
|
|
||||||
commands in CTRL-X submode *i_CTRL-X_index*
|
commands in CTRL-X submode *i_CTRL-X_index*
|
||||||
|
|
||||||
@ -441,10 +445,14 @@ tag char note action in Normal mode ~
|
|||||||
|<S-Up>| <S-Up> 1 same as CTRL-B
|
|<S-Up>| <S-Up> 1 same as CTRL-B
|
||||||
|<Undo>| <Undo> 2 same as "u"
|
|<Undo>| <Undo> 2 same as "u"
|
||||||
|<Up>| <Up> 1 same as "k"
|
|<Up>| <Up> 1 same as "k"
|
||||||
|<MouseDown>| <MouseDown> scroll three lines downwards
|
|<ScrollWheelDown>| <ScrollWheelDown> move window three lines down
|
||||||
|<S-MouseDown>| <S-MouseDown> scroll a full page downwards
|
|<S-ScrollWheelDown>| <S-ScrollWheelDown> move window one page down
|
||||||
|<MouseUp>| <MouseUp> scroll three lines upwards
|
|<ScrollWheelUp>| <ScrollWheelUp> move window three lines up
|
||||||
|<S-MouseUp>| <S-MouseUp> scroll a full page upwards
|
|<S-ScrollWheelUp>| <S-ScrollWheelUp> move window one page up
|
||||||
|
|<ScrollWheelLeft>| <ScrollWheelLeft> move window six columns left
|
||||||
|
|<S-ScrollWheelLeft>| <S-ScrollWheelLeft> move window one page left
|
||||||
|
|<ScrollWheelRight>| <ScrollWheelRight> move window six columns right
|
||||||
|
|<S-ScrollWheelRight>| <S-ScrollWheelRight> move window one page right
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
2.1 Text objects *objects*
|
2.1 Text objects *objects*
|
||||||
|
@ -359,10 +359,14 @@ CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J*
|
|||||||
<PageUp> move window one page up *i_<PageUp>*
|
<PageUp> move window one page up *i_<PageUp>*
|
||||||
<S-Down> move window one page down *i_<S-Down>*
|
<S-Down> move window one page down *i_<S-Down>*
|
||||||
<PageDown> move window one page down *i_<PageDown>*
|
<PageDown> move window one page down *i_<PageDown>*
|
||||||
<MouseDown> scroll three lines down *i_<MouseDown>*
|
<ScrollWheelDown> move window three lines down *i_<ScrollWheelDown>*
|
||||||
<S-MouseDown> scroll a full page down *i_<S-MouseDown>*
|
<S-ScrollWheelDown> move window one page down *i_<S-ScrollWheelDown>*
|
||||||
<MouseUp> scroll three lines up *i_<MouseUp>*
|
<ScrollWheelUp> move window three lines up *i_<ScrollWheelUp>*
|
||||||
<S-MouseUp> scroll a full page up *i_<S-MouseUp>*
|
<S-ScrollWheelUp> move window one page up *i_<S-ScrollWheelUp>*
|
||||||
|
<ScrollWheelLeft> move window six columns left *i_<ScrollWheelLeft>*
|
||||||
|
<S-ScrollWheelLeft> move window one page left *i_<S-ScrollWheelLeft>*
|
||||||
|
<ScrollWheelRight> move window six columns right *i_<ScrollWheelRight>*
|
||||||
|
<S-ScrollWheelRight> move window one page right *i_<S-ScrollWheelRight>*
|
||||||
CTRL-O execute one command, return to Insert mode *i_CTRL-O*
|
CTRL-O execute one command, return to Insert mode *i_CTRL-O*
|
||||||
CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
|
CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
|
||||||
CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L*
|
CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L*
|
||||||
|
@ -242,7 +242,8 @@ This allows quick adjustment of the relative offset of 'scrollbind' windows.
|
|||||||
|
|
||||||
When your mouse has a scroll wheel, it should work with Vim in the GUI. How
|
When your mouse has a scroll wheel, it should work with Vim in the GUI. How
|
||||||
it works depends on your system. It might also work in an xterm
|
it works depends on your system. It might also work in an xterm
|
||||||
|xterm-mouse-wheel|.
|
|xterm-mouse-wheel|. By default only vertical scroll wheels are supported,
|
||||||
|
but some GUIs also support horizontal scroll wheels.
|
||||||
|
|
||||||
For the Win32 GUI the scroll action is hard coded. It works just like
|
For the Win32 GUI the scroll action is hard coded. It works just like
|
||||||
dragging the scrollbar of the current window. How many lines are scrolled
|
dragging the scrollbar of the current window. How many lines are scrolled
|
||||||
@ -250,24 +251,36 @@ depends on your mouse driver. If the scroll action causes input focus
|
|||||||
problems, see |intellimouse-wheel-problems|.
|
problems, see |intellimouse-wheel-problems|.
|
||||||
|
|
||||||
For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
|
For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
|
||||||
presses <MouseDown> and <MouseUp>. The default action for these keys are:
|
presses <ScrollWheelUp>, <ScrollWheelDown>, <ScrollWheelLeft> and
|
||||||
<MouseDown> scroll three lines down. *<MouseDown>*
|
<ScrollWheelRight>. For example, if you push the scroll wheel upwards a
|
||||||
<S-MouseDown> scroll a full page down. *<S-MouseDown>*
|
<ScrollWheelUp> key press is generated causing the window to scroll upwards
|
||||||
<C-MouseDown> scroll a full page down. *<C-MouseDown>*
|
(while the text is actually moving downwards). The default action for these
|
||||||
<MouseUp> scroll three lines up. *<MouseUp>*
|
keys are:
|
||||||
<S-MouseUp> scroll a full page up. *<S-MouseUp>*
|
<ScrollWheelUp> scroll three lines up *<ScrollWheelUp>*
|
||||||
<C-MouseUp> scroll a full page up. *<C-MouseUp>*
|
<S-ScrollWheelUp> scroll one page up *<S-ScrollWheelUp>*
|
||||||
|
<C-ScrollWheelUp> scroll one page up *<C-ScrollWheelUp>*
|
||||||
|
<ScrollWheelDown> scroll three lines down *<ScrollWheelDown>*
|
||||||
|
<S-ScrollWheelDown> scroll one page down *<S-ScrollWheelDown>*
|
||||||
|
<C-ScrollWheelDown> scroll one page down *<C-ScrollWheelDown>*
|
||||||
|
<ScrollWheelLeft> scroll six columns left *<ScrollWheelLeft>*
|
||||||
|
<S-ScrollWheelLeft> scroll one page left *<S-ScrollWheelLeft>*
|
||||||
|
<C-ScrollWheelLeft> scroll one page left *<C-ScrollWheelLeft>*
|
||||||
|
<ScrollWheelRight> scroll six columns right *<ScrollWheelRight>*
|
||||||
|
<S-ScrollWheelRight> scroll one page right *<S-ScrollWheelRight>*
|
||||||
|
<C-ScrollWheelRight> scroll one page right *<C-ScrollWheelRight>*
|
||||||
This should work in all modes, except when editing the command line.
|
This should work in all modes, except when editing the command line.
|
||||||
|
|
||||||
Note that <MouseDown> is used for scrolling the text down, this happens when
|
Note that horizontal scrolling only works if 'nowrap' is set. Also, unless
|
||||||
you turn the mouse wheel up!
|
the "h" flag in 'guioptions' is set, the cursor moves to the longest visible
|
||||||
|
line if the cursor line is about to be scrolled off the screen (similarly to
|
||||||
|
how the horizontal scrollbar works).
|
||||||
|
|
||||||
You can modify this behavior by mapping the keys. For example, to make the
|
You can modify the default behavior by mapping the keys. For example, to make
|
||||||
scroll wheel move one line or half a page in Normal mode: >
|
the scroll wheel move one line or half a page in Normal mode: >
|
||||||
:map <MouseDown> <C-Y>
|
:map <ScrollWheelUp> <C-Y>
|
||||||
:map <S-MouseDown> <C-U>
|
:map <S-ScrollWheelUp> <C-U>
|
||||||
:map <MouseUp> <C-E>
|
:map <ScrollWheelDown> <C-E>
|
||||||
:map <S-MouseUp> <C-D>
|
:map <S-ScrollWheelDown> <C-D>
|
||||||
You can also use Alt and Ctrl modifiers.
|
You can also use Alt and Ctrl modifiers.
|
||||||
|
|
||||||
This only works when Vim gets the scroll wheel events, of course. You can
|
This only works when Vim gets the scroll wheel events, of course. You can
|
||||||
@ -280,6 +293,10 @@ your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: >
|
|||||||
ZAxisMapping 4 5
|
ZAxisMapping 4 5
|
||||||
See the XFree86 documentation for information.
|
See the XFree86 documentation for information.
|
||||||
|
|
||||||
|
*<MouseDown>* *<MouseUp>*
|
||||||
|
The keys <MouseDown> and <MouseUp> have been deprecated. Use <ScrollWheelUp>
|
||||||
|
instead of <MouseDown> and use <ScrollWheelDown> instead of <MouseUp>.
|
||||||
|
|
||||||
*xterm-mouse-wheel*
|
*xterm-mouse-wheel*
|
||||||
To use the mouse wheel in a new xterm you only have to make the scroll wheel
|
To use the mouse wheel in a new xterm you only have to make the scroll wheel
|
||||||
work in your Xserver, as mentioned above.
|
work in your Xserver, as mentioned above.
|
||||||
@ -288,8 +305,8 @@ To use the mouse wheel in an older xterm you must do this:
|
|||||||
1. Make it work in your Xserver, as mentioned above.
|
1. Make it work in your Xserver, as mentioned above.
|
||||||
2. Add translations for the xterm, so that the xterm will pass a scroll event
|
2. Add translations for the xterm, so that the xterm will pass a scroll event
|
||||||
to Vim as an escape sequence.
|
to Vim as an escape sequence.
|
||||||
3. Add mappings in Vim, to interpret the escape sequences as <MouseUp> or
|
3. Add mappings in Vim, to interpret the escape sequences as <ScrollWheelDown>
|
||||||
<MouseDown> keys.
|
or <ScrollWheelUp> keys.
|
||||||
|
|
||||||
You can do the translations by adding this to your ~.Xdefaults file (or other
|
You can do the translations by adding this to your ~.Xdefaults file (or other
|
||||||
file where your X resources are kept): >
|
file where your X resources are kept): >
|
||||||
@ -303,13 +320,13 @@ file where your X resources are kept): >
|
|||||||
<Btn5Up>:
|
<Btn5Up>:
|
||||||
|
|
||||||
Add these mappings to your vimrc file: >
|
Add these mappings to your vimrc file: >
|
||||||
:map <M-Esc>[62~ <MouseDown>
|
:map <M-Esc>[62~ <ScrollWheelUp>
|
||||||
:map! <M-Esc>[62~ <MouseDown>
|
:map! <M-Esc>[62~ <ScrollWheelUp>
|
||||||
:map <M-Esc>[63~ <MouseUp>
|
:map <M-Esc>[63~ <ScrollWheelDown>
|
||||||
:map! <M-Esc>[63~ <MouseUp>
|
:map! <M-Esc>[63~ <ScrollWheelDown>
|
||||||
:map <M-Esc>[64~ <S-MouseDown>
|
:map <M-Esc>[64~ <S-ScrollWheelUp>
|
||||||
:map! <M-Esc>[64~ <S-MouseDown>
|
:map! <M-Esc>[64~ <S-ScrollWheelUp>
|
||||||
:map <M-Esc>[65~ <S-MouseUp>
|
:map <M-Esc>[65~ <S-ScrollWheelDown>
|
||||||
:map! <M-Esc>[65~ <S-MouseUp>
|
:map! <M-Esc>[65~ <S-ScrollWheelDown>
|
||||||
<
|
<
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
@ -3056,12 +3056,14 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
|||||||
<C-Insert> os_dos.txt /*<C-Insert>*
|
<C-Insert> os_dos.txt /*<C-Insert>*
|
||||||
<C-Left> motion.txt /*<C-Left>*
|
<C-Left> motion.txt /*<C-Left>*
|
||||||
<C-LeftMouse> tagsrch.txt /*<C-LeftMouse>*
|
<C-LeftMouse> tagsrch.txt /*<C-LeftMouse>*
|
||||||
<C-MouseDown> scroll.txt /*<C-MouseDown>*
|
|
||||||
<C-MouseUp> scroll.txt /*<C-MouseUp>*
|
|
||||||
<C-PageDown> tabpage.txt /*<C-PageDown>*
|
<C-PageDown> tabpage.txt /*<C-PageDown>*
|
||||||
<C-PageUp> tabpage.txt /*<C-PageUp>*
|
<C-PageUp> tabpage.txt /*<C-PageUp>*
|
||||||
<C-Right> motion.txt /*<C-Right>*
|
<C-Right> motion.txt /*<C-Right>*
|
||||||
<C-RightMouse> tagsrch.txt /*<C-RightMouse>*
|
<C-RightMouse> tagsrch.txt /*<C-RightMouse>*
|
||||||
|
<C-ScrollWheelDown> scroll.txt /*<C-ScrollWheelDown>*
|
||||||
|
<C-ScrollWheelLeft> scroll.txt /*<C-ScrollWheelLeft>*
|
||||||
|
<C-ScrollWheelRight> scroll.txt /*<C-ScrollWheelRight>*
|
||||||
|
<C-ScrollWheelUp> scroll.txt /*<C-ScrollWheelUp>*
|
||||||
<CR> motion.txt /*<CR>*
|
<CR> motion.txt /*<CR>*
|
||||||
<CSI> intro.txt /*<CSI>*
|
<CSI> intro.txt /*<CSI>*
|
||||||
<Char-> map.txt /*<Char->*
|
<Char-> map.txt /*<Char->*
|
||||||
@ -3140,10 +3142,12 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
|||||||
<S-Insert> os_dos.txt /*<S-Insert>*
|
<S-Insert> os_dos.txt /*<S-Insert>*
|
||||||
<S-Left> motion.txt /*<S-Left>*
|
<S-Left> motion.txt /*<S-Left>*
|
||||||
<S-LeftMouse> term.txt /*<S-LeftMouse>*
|
<S-LeftMouse> term.txt /*<S-LeftMouse>*
|
||||||
<S-MouseDown> scroll.txt /*<S-MouseDown>*
|
|
||||||
<S-MouseUp> scroll.txt /*<S-MouseUp>*
|
|
||||||
<S-Right> motion.txt /*<S-Right>*
|
<S-Right> motion.txt /*<S-Right>*
|
||||||
<S-RightMouse> term.txt /*<S-RightMouse>*
|
<S-RightMouse> term.txt /*<S-RightMouse>*
|
||||||
|
<S-ScrollWheelDown> scroll.txt /*<S-ScrollWheelDown>*
|
||||||
|
<S-ScrollWheelLeft> scroll.txt /*<S-ScrollWheelLeft>*
|
||||||
|
<S-ScrollWheelRight> scroll.txt /*<S-ScrollWheelRight>*
|
||||||
|
<S-ScrollWheelUp> scroll.txt /*<S-ScrollWheelUp>*
|
||||||
<S-Tab> term.txt /*<S-Tab>*
|
<S-Tab> term.txt /*<S-Tab>*
|
||||||
<S-Up> scroll.txt /*<S-Up>*
|
<S-Up> scroll.txt /*<S-Up>*
|
||||||
<S-xF1> term.txt /*<S-xF1>*
|
<S-xF1> term.txt /*<S-xF1>*
|
||||||
@ -3152,6 +3156,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
|||||||
<S-xF4> term.txt /*<S-xF4>*
|
<S-xF4> term.txt /*<S-xF4>*
|
||||||
<SID> map.txt /*<SID>*
|
<SID> map.txt /*<SID>*
|
||||||
<SNR> map.txt /*<SNR>*
|
<SNR> map.txt /*<SNR>*
|
||||||
|
<ScrollWheelDown> scroll.txt /*<ScrollWheelDown>*
|
||||||
|
<ScrollWheelLeft> scroll.txt /*<ScrollWheelLeft>*
|
||||||
|
<ScrollWheelRight> scroll.txt /*<ScrollWheelRight>*
|
||||||
|
<ScrollWheelUp> scroll.txt /*<ScrollWheelUp>*
|
||||||
<Space> motion.txt /*<Space>*
|
<Space> motion.txt /*<Space>*
|
||||||
<Tab> motion.txt /*<Tab>*
|
<Tab> motion.txt /*<Tab>*
|
||||||
<Undo> undo.txt /*<Undo>*
|
<Undo> undo.txt /*<Undo>*
|
||||||
@ -6166,18 +6174,22 @@ i_<Home> insert.txt /*i_<Home>*
|
|||||||
i_<Insert> insert.txt /*i_<Insert>*
|
i_<Insert> insert.txt /*i_<Insert>*
|
||||||
i_<Left> insert.txt /*i_<Left>*
|
i_<Left> insert.txt /*i_<Left>*
|
||||||
i_<LeftMouse> insert.txt /*i_<LeftMouse>*
|
i_<LeftMouse> insert.txt /*i_<LeftMouse>*
|
||||||
i_<MouseDown> insert.txt /*i_<MouseDown>*
|
|
||||||
i_<MouseUp> insert.txt /*i_<MouseUp>*
|
|
||||||
i_<NL> insert.txt /*i_<NL>*
|
i_<NL> insert.txt /*i_<NL>*
|
||||||
i_<PageDown> insert.txt /*i_<PageDown>*
|
i_<PageDown> insert.txt /*i_<PageDown>*
|
||||||
i_<PageUp> insert.txt /*i_<PageUp>*
|
i_<PageUp> insert.txt /*i_<PageUp>*
|
||||||
i_<Right> insert.txt /*i_<Right>*
|
i_<Right> insert.txt /*i_<Right>*
|
||||||
i_<S-Down> insert.txt /*i_<S-Down>*
|
i_<S-Down> insert.txt /*i_<S-Down>*
|
||||||
i_<S-Left> insert.txt /*i_<S-Left>*
|
i_<S-Left> insert.txt /*i_<S-Left>*
|
||||||
i_<S-MouseDown> insert.txt /*i_<S-MouseDown>*
|
|
||||||
i_<S-MouseUp> insert.txt /*i_<S-MouseUp>*
|
|
||||||
i_<S-Right> insert.txt /*i_<S-Right>*
|
i_<S-Right> insert.txt /*i_<S-Right>*
|
||||||
|
i_<S-ScrollWheelDown> insert.txt /*i_<S-ScrollWheelDown>*
|
||||||
|
i_<S-ScrollWheelLeft> insert.txt /*i_<S-ScrollWheelLeft>*
|
||||||
|
i_<S-ScrollWheelRight> insert.txt /*i_<S-ScrollWheelRight>*
|
||||||
|
i_<S-ScrollWheelUp> insert.txt /*i_<S-ScrollWheelUp>*
|
||||||
i_<S-Up> insert.txt /*i_<S-Up>*
|
i_<S-Up> insert.txt /*i_<S-Up>*
|
||||||
|
i_<ScrollWheelDown> insert.txt /*i_<ScrollWheelDown>*
|
||||||
|
i_<ScrollWheelLeft> insert.txt /*i_<ScrollWheelLeft>*
|
||||||
|
i_<ScrollWheelRight> insert.txt /*i_<ScrollWheelRight>*
|
||||||
|
i_<ScrollWheelUp> insert.txt /*i_<ScrollWheelUp>*
|
||||||
i_<Tab> insert.txt /*i_<Tab>*
|
i_<Tab> insert.txt /*i_<Tab>*
|
||||||
i_<Up> insert.txt /*i_<Up>*
|
i_<Up> insert.txt /*i_<Up>*
|
||||||
i_BS insert.txt /*i_BS*
|
i_BS insert.txt /*i_BS*
|
||||||
@ -7599,6 +7611,7 @@ synIDattr() eval.txt /*synIDattr()*
|
|||||||
synIDtrans() eval.txt /*synIDtrans()*
|
synIDtrans() eval.txt /*synIDtrans()*
|
||||||
syncbind scroll.txt /*syncbind*
|
syncbind scroll.txt /*syncbind*
|
||||||
syncolor syntax.txt /*syncolor*
|
syncolor syntax.txt /*syncolor*
|
||||||
|
synconcealed() eval.txt /*synconcealed()*
|
||||||
synload-1 syntax.txt /*synload-1*
|
synload-1 syntax.txt /*synload-1*
|
||||||
synload-2 syntax.txt /*synload-2*
|
synload-2 syntax.txt /*synload-2*
|
||||||
synload-3 syntax.txt /*synload-3*
|
synload-3 syntax.txt /*synload-3*
|
||||||
|
@ -30,15 +30,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
|||||||
*known-bugs*
|
*known-bugs*
|
||||||
-------------------- Known bugs and current work -----------------------
|
-------------------- Known bugs and current work -----------------------
|
||||||
|
|
||||||
concealends does not appear to work.
|
|
||||||
|
|
||||||
if_python3.c is missing some changes that were applied to if_python.c.
|
|
||||||
Find the old version of if_python.c from when the copy was made.
|
|
||||||
|
|
||||||
Move more common code from if_python.c and if_python3.c to if_py_both.h
|
|
||||||
|
|
||||||
Add documentation for Python 3 support.
|
|
||||||
|
|
||||||
Include patch for horizontal scoll wheel? (Bjorn Winckler, 2010 Jul 20)
|
Include patch for horizontal scoll wheel? (Bjorn Winckler, 2010 Jul 20)
|
||||||
Additional patch Jul 21.
|
Additional patch Jul 21.
|
||||||
|
|
||||||
@ -50,9 +41,13 @@ Additional patch Jul 21.
|
|||||||
Patch for :find completion. (Nazri Ramliy)
|
Patch for :find completion. (Nazri Ramliy)
|
||||||
But I prefer to keep term.h and include/term.h He will work on it.
|
But I prefer to keep term.h and include/term.h He will work on it.
|
||||||
|
|
||||||
|
Add hg changes to version7.txt
|
||||||
|
|
||||||
Before release 7.3:
|
Before release 7.3:
|
||||||
- Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23)
|
- Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23)
|
||||||
|
|
||||||
|
Move more common code from if_python.c and if_python3.c to if_py_both.h
|
||||||
|
|
||||||
Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6)
|
Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6)
|
||||||
|
|
||||||
Test 69 breaks on MS-Windows, both 32 and 64 builds. (George Reilly, 2010 Feb
|
Test 69 breaks on MS-Windows, both 32 and 64 builds. (George Reilly, 2010 Feb
|
||||||
|
@ -10357,7 +10357,7 @@ Files: src/ex_cmds2.c
|
|||||||
|
|
||||||
Patch 6.2.066 (extra)
|
Patch 6.2.066 (extra)
|
||||||
Problem: Ruby interface doesn't work with Ruby 1.8.0.
|
Problem: Ruby interface doesn't work with Ruby 1.8.0.
|
||||||
Solution: Change "defout" to "stdout". (Aron Grifis)
|
Solution: Change "defout" to "stdout". (Aron Griffis)
|
||||||
Change dynamic loading. (Taro Muraoka)
|
Change dynamic loading. (Taro Muraoka)
|
||||||
Files: src/if_ruby.c, src/Make_mvc.mak
|
Files: src/if_ruby.c, src/Make_mvc.mak
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*version7.txt* For Vim version 7.3b. Last change: 2010 Jul 24
|
*version7.txt* For Vim version 7.3b. Last change: 2010 Jul 25
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -5530,7 +5530,7 @@ Files: src/gui_mac.c
|
|||||||
|
|
||||||
Patch 7.1.125
|
Patch 7.1.125
|
||||||
Problem: The TermResponse autocommand event is not always triggered. (Aron
|
Problem: The TermResponse autocommand event is not always triggered. (Aron
|
||||||
Griffix)
|
Griffis)
|
||||||
Solution: When unblocking autocommands check if v:termresponse changed and
|
Solution: When unblocking autocommands check if v:termresponse changed and
|
||||||
trigger the event then.
|
trigger the event then.
|
||||||
Files: src/buffer.c, src/diff.c, src/ex_getln.c, src/fileio.c,
|
Files: src/buffer.c, src/diff.c, src/ex_getln.c, src/fileio.c,
|
||||||
@ -8679,7 +8679,7 @@ Files: src/testdir/Makefile
|
|||||||
|
|
||||||
Patch 7.2.218
|
Patch 7.2.218
|
||||||
Problem: Cannot build GTK with hangul_input feature. (Dominique Pelle)
|
Problem: Cannot build GTK with hangul_input feature. (Dominique Pelle)
|
||||||
Solution: Adjuste #ifdef. (SungHyun Nam)
|
Solution: Adjust #ifdef. (SungHyun Nam)
|
||||||
Files: src/gui.c
|
Files: src/gui.c
|
||||||
|
|
||||||
Patch 7.2.219 (extra)
|
Patch 7.2.219 (extra)
|
||||||
@ -9905,7 +9905,7 @@ Files: runtime/doc/autocmd.txt, src/if_cscope.c
|
|||||||
|
|
||||||
Patch 7.2.434 (after 7.2.432)
|
Patch 7.2.434 (after 7.2.432)
|
||||||
Problem: Compilation fails without the multi-lang feature.
|
Problem: Compilation fails without the multi-lang feature.
|
||||||
Solution: Add #ifdefs. (Johm Marriott)
|
Solution: Add #ifdefs. (John Marriott)
|
||||||
Files: src/menu.c
|
Files: src/menu.c
|
||||||
|
|
||||||
Patch 7.2.435 (after 7.2.430)
|
Patch 7.2.435 (after 7.2.430)
|
||||||
@ -10032,12 +10032,10 @@ Some versions of Ruby redefine rb_str_new2 to rb_str_new_cstr.
|
|||||||
|
|
||||||
Window title not updated after file dropped.
|
Window title not updated after file dropped.
|
||||||
|
|
||||||
"g8" doesn't work properly on a NUL.
|
|
||||||
|
|
||||||
Fixed crash for ":find" completion, might also happen in other path expansion
|
Fixed crash for ":find" completion, might also happen in other path expansion
|
||||||
usage.
|
usage.
|
||||||
|
|
||||||
When 'searchhl' causes a hang make CTRL-C disable 'shearchhl'.
|
When 'searchhl' causes a hang make CTRL-C disable 'searchhl'.
|
||||||
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
44
src/edit.c
44
src/edit.c
@ -224,7 +224,7 @@ static void ins_del __ARGS((void));
|
|||||||
static int ins_bs __ARGS((int c, int mode, int *inserted_space_p));
|
static int ins_bs __ARGS((int c, int mode, int *inserted_space_p));
|
||||||
#ifdef FEAT_MOUSE
|
#ifdef FEAT_MOUSE
|
||||||
static void ins_mouse __ARGS((int c));
|
static void ins_mouse __ARGS((int c));
|
||||||
static void ins_mousescroll __ARGS((int up));
|
static void ins_mousescroll __ARGS((int dir));
|
||||||
#endif
|
#endif
|
||||||
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
||||||
static void ins_tabline __ARGS((int c));
|
static void ins_tabline __ARGS((int c));
|
||||||
@ -1112,11 +1112,19 @@ doESCkey:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case K_MOUSEDOWN: /* Default action for scroll wheel up: scroll up */
|
case K_MOUSEDOWN: /* Default action for scroll wheel up: scroll up */
|
||||||
ins_mousescroll(FALSE);
|
ins_mousescroll(MSCR_DOWN);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_MOUSEUP: /* Default action for scroll wheel down: scroll down */
|
case K_MOUSEUP: /* Default action for scroll wheel down: scroll down */
|
||||||
ins_mousescroll(TRUE);
|
ins_mousescroll(MSCR_UP);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_MOUSELEFT: /* Scroll wheel left */
|
||||||
|
ins_mousescroll(MSCR_LEFT);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_MOUSERIGHT: /* Scroll wheel right */
|
||||||
|
ins_mousescroll(MSCR_RIGHT);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_GUI_TABLINE
|
#ifdef FEAT_GUI_TABLINE
|
||||||
@ -3516,7 +3524,8 @@ ins_compl_prep(c)
|
|||||||
edit_submode_extra = NULL;
|
edit_submode_extra = NULL;
|
||||||
|
|
||||||
/* Ignore end of Select mode mapping and mouse scroll buttons. */
|
/* Ignore end of Select mode mapping and mouse scroll buttons. */
|
||||||
if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP)
|
if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP
|
||||||
|
|| c == K_MOUSELEFT || c == K_MOUSERIGHT)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
/* Set "compl_get_longest" when finding the first matches. */
|
/* Set "compl_get_longest" when finding the first matches. */
|
||||||
@ -8859,8 +8868,8 @@ ins_mouse(c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ins_mousescroll(up)
|
ins_mousescroll(dir)
|
||||||
int up;
|
int dir;
|
||||||
{
|
{
|
||||||
pos_T tpos;
|
pos_T tpos;
|
||||||
# if defined(FEAT_WINDOWS)
|
# if defined(FEAT_WINDOWS)
|
||||||
@ -8897,11 +8906,28 @@ ins_mousescroll(up)
|
|||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
# endif
|
# endif
|
||||||
|
{
|
||||||
|
if (dir == MSCR_DOWN || dir == MSCR_UP)
|
||||||
{
|
{
|
||||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||||
scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline));
|
scroll_redraw(dir,
|
||||||
|
(long)(curwin->w_botline - curwin->w_topline));
|
||||||
else
|
else
|
||||||
scroll_redraw(up, 3L);
|
scroll_redraw(dir, 3L);
|
||||||
|
}
|
||||||
|
#ifdef FEAT_GUI
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int val, step = 6;
|
||||||
|
|
||||||
|
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||||
|
step = W_WIDTH(curwin);
|
||||||
|
val = curwin->w_leftcol + (dir == MSCR_RIGHT ? -step : step);
|
||||||
|
if (val < 0)
|
||||||
|
val = 0;
|
||||||
|
gui_do_horiz_scroll(val, TRUE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
# ifdef FEAT_INS_EXPAND
|
# ifdef FEAT_INS_EXPAND
|
||||||
did_scroll = TRUE;
|
did_scroll = TRUE;
|
||||||
# endif
|
# endif
|
||||||
@ -8985,7 +9011,7 @@ ins_horscroll()
|
|||||||
|
|
||||||
undisplay_dollar();
|
undisplay_dollar();
|
||||||
tpos = curwin->w_cursor;
|
tpos = curwin->w_cursor;
|
||||||
if (gui_do_horiz_scroll())
|
if (gui_do_horiz_scroll(scrollbar_value, FALSE))
|
||||||
{
|
{
|
||||||
start_arrow(&tpos);
|
start_arrow(&tpos);
|
||||||
# ifdef FEAT_CINDENT
|
# ifdef FEAT_CINDENT
|
||||||
|
@ -10927,6 +10927,8 @@ f_getchar(argvars, rettv)
|
|||||||
|| n == K_X2MOUSE
|
|| n == K_X2MOUSE
|
||||||
|| n == K_X2DRAG
|
|| n == K_X2DRAG
|
||||||
|| n == K_X2RELEASE
|
|| n == K_X2RELEASE
|
||||||
|
|| n == K_MOUSELEFT
|
||||||
|
|| n == K_MOUSERIGHT
|
||||||
|| n == K_MOUSEDOWN
|
|| n == K_MOUSEDOWN
|
||||||
|| n == K_MOUSEUP)
|
|| n == K_MOUSEUP)
|
||||||
{
|
{
|
||||||
|
@ -1334,6 +1334,8 @@ getcmdline(firstc, count, indent)
|
|||||||
/* Mouse scroll wheel: ignored here */
|
/* Mouse scroll wheel: ignored here */
|
||||||
case K_MOUSEDOWN:
|
case K_MOUSEDOWN:
|
||||||
case K_MOUSEUP:
|
case K_MOUSEUP:
|
||||||
|
case K_MOUSELEFT:
|
||||||
|
case K_MOUSERIGHT:
|
||||||
/* Alternate buttons ignored here */
|
/* Alternate buttons ignored here */
|
||||||
case K_X1MOUSE:
|
case K_X1MOUSE:
|
||||||
case K_X1DRAG:
|
case K_X1DRAG:
|
||||||
@ -1361,7 +1363,7 @@ getcmdline(firstc, count, indent)
|
|||||||
case K_HOR_SCROLLBAR:
|
case K_HOR_SCROLLBAR:
|
||||||
if (msg_scrolled == 0)
|
if (msg_scrolled == 0)
|
||||||
{
|
{
|
||||||
gui_do_horiz_scroll();
|
gui_do_horiz_scroll(scrollbar_value, FALSE);
|
||||||
redrawcmd();
|
redrawcmd();
|
||||||
}
|
}
|
||||||
goto cmdline_not_changed;
|
goto cmdline_not_changed;
|
||||||
|
117
src/gui.c
117
src/gui.c
@ -31,6 +31,7 @@ static int gui_has_tabline __ARGS((void));
|
|||||||
#endif
|
#endif
|
||||||
static void gui_do_scrollbar __ARGS((win_T *wp, int which, int enable));
|
static void gui_do_scrollbar __ARGS((win_T *wp, int which, int enable));
|
||||||
static colnr_T scroll_line_len __ARGS((linenr_T lnum));
|
static colnr_T scroll_line_len __ARGS((linenr_T lnum));
|
||||||
|
static linenr_T gui_find_longest_lnum __ARGS((void));
|
||||||
static void gui_update_horiz_scrollbar __ARGS((int));
|
static void gui_update_horiz_scrollbar __ARGS((int));
|
||||||
static void gui_set_fg_color __ARGS((char_u *name));
|
static void gui_set_fg_color __ARGS((char_u *name));
|
||||||
static void gui_set_bg_color __ARGS((char_u *name));
|
static void gui_set_bg_color __ARGS((char_u *name));
|
||||||
@ -2759,7 +2760,8 @@ fill_mouse_coord(p, col, row)
|
|||||||
* button --- may be any of MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT,
|
* button --- may be any of MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT,
|
||||||
* MOUSE_X1, MOUSE_X2
|
* MOUSE_X1, MOUSE_X2
|
||||||
* MOUSE_DRAG, or MOUSE_RELEASE.
|
* MOUSE_DRAG, or MOUSE_RELEASE.
|
||||||
* MOUSE_4 and MOUSE_5 are used for a scroll wheel.
|
* MOUSE_4 and MOUSE_5 are used for vertical scroll wheel,
|
||||||
|
* MOUSE_6 and MOUSE_7 for horizontal scroll wheel.
|
||||||
* x, y --- Coordinates of mouse in pixels.
|
* x, y --- Coordinates of mouse in pixels.
|
||||||
* repeated_click --- TRUE if this click comes only a short time after a
|
* repeated_click --- TRUE if this click comes only a short time after a
|
||||||
* previous click.
|
* previous click.
|
||||||
@ -2803,6 +2805,12 @@ gui_send_mouse_event(button, x, y, repeated_click, modifiers)
|
|||||||
goto button_set;
|
goto button_set;
|
||||||
case MOUSE_5:
|
case MOUSE_5:
|
||||||
button_char = KE_MOUSEUP;
|
button_char = KE_MOUSEUP;
|
||||||
|
goto button_set;
|
||||||
|
case MOUSE_6:
|
||||||
|
button_char = KE_MOUSELEFT;
|
||||||
|
goto button_set;
|
||||||
|
case MOUSE_7:
|
||||||
|
button_char = KE_MOUSERIGHT;
|
||||||
button_set:
|
button_set:
|
||||||
{
|
{
|
||||||
/* Don't put events in the input queue now. */
|
/* Don't put events in the input queue now. */
|
||||||
@ -3845,14 +3853,14 @@ gui_drag_scrollbar(sb, value, still_dragging)
|
|||||||
scrollbar_value = value;
|
scrollbar_value = value;
|
||||||
|
|
||||||
if (State & NORMAL)
|
if (State & NORMAL)
|
||||||
gui_do_horiz_scroll();
|
gui_do_horiz_scroll(scrollbar_value, FALSE);
|
||||||
else if (State & INSERT)
|
else if (State & INSERT)
|
||||||
ins_horscroll();
|
ins_horscroll();
|
||||||
else if (State & CMDLINE)
|
else if (State & CMDLINE)
|
||||||
{
|
{
|
||||||
if (msg_scrolled == 0)
|
if (msg_scrolled == 0)
|
||||||
{
|
{
|
||||||
gui_do_horiz_scroll();
|
gui_do_horiz_scroll(scrollbar_value, FALSE);
|
||||||
redrawcmdline();
|
redrawcmdline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4319,6 +4327,51 @@ scroll_line_len(lnum)
|
|||||||
* search for it when scrolling horizontally. */
|
* search for it when scrolling horizontally. */
|
||||||
static linenr_T longest_lnum = 0;
|
static linenr_T longest_lnum = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Find longest visible line number. If this is not possible (or not desired,
|
||||||
|
* by setting 'h' in "guioptions") then the current line number is returned.
|
||||||
|
*/
|
||||||
|
static linenr_T
|
||||||
|
gui_find_longest_lnum()
|
||||||
|
{
|
||||||
|
linenr_T ret = 0;
|
||||||
|
|
||||||
|
/* Calculate maximum for horizontal scrollbar. Check for reasonable
|
||||||
|
* line numbers, topline and botline can be invalid when displaying is
|
||||||
|
* postponed. */
|
||||||
|
if (vim_strchr(p_go, GO_HORSCROLL) == NULL
|
||||||
|
&& curwin->w_topline <= curwin->w_cursor.lnum
|
||||||
|
&& curwin->w_botline > curwin->w_cursor.lnum
|
||||||
|
&& curwin->w_botline <= curbuf->b_ml.ml_line_count + 1)
|
||||||
|
{
|
||||||
|
linenr_T lnum;
|
||||||
|
colnr_T n;
|
||||||
|
long max = 0;
|
||||||
|
|
||||||
|
/* Use maximum of all visible lines. Remember the lnum of the
|
||||||
|
* longest line, closest to the cursor line. Used when scrolling
|
||||||
|
* below. */
|
||||||
|
for (lnum = curwin->w_topline; lnum < curwin->w_botline; ++lnum)
|
||||||
|
{
|
||||||
|
n = scroll_line_len(lnum);
|
||||||
|
if (n > (colnr_T)max)
|
||||||
|
{
|
||||||
|
max = n;
|
||||||
|
ret = lnum;
|
||||||
|
}
|
||||||
|
else if (n == (colnr_T)max
|
||||||
|
&& abs((int)(lnum - curwin->w_cursor.lnum))
|
||||||
|
< abs((int)(ret - curwin->w_cursor.lnum)))
|
||||||
|
ret = lnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* Use cursor line only. */
|
||||||
|
ret = curwin->w_cursor.lnum;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gui_update_horiz_scrollbar(force)
|
gui_update_horiz_scrollbar(force)
|
||||||
int force;
|
int force;
|
||||||
@ -4358,38 +4411,9 @@ gui_update_horiz_scrollbar(force)
|
|||||||
{
|
{
|
||||||
value = curwin->w_leftcol;
|
value = curwin->w_leftcol;
|
||||||
|
|
||||||
/* Calculate maximum for horizontal scrollbar. Check for reasonable
|
longest_lnum = gui_find_longest_lnum();
|
||||||
* line numbers, topline and botline can be invalid when displaying is
|
max = scroll_line_len(longest_lnum);
|
||||||
* postponed. */
|
|
||||||
if (vim_strchr(p_go, GO_HORSCROLL) == NULL
|
|
||||||
&& curwin->w_topline <= curwin->w_cursor.lnum
|
|
||||||
&& curwin->w_botline > curwin->w_cursor.lnum
|
|
||||||
&& curwin->w_botline <= curbuf->b_ml.ml_line_count + 1)
|
|
||||||
{
|
|
||||||
linenr_T lnum;
|
|
||||||
colnr_T n;
|
|
||||||
|
|
||||||
/* Use maximum of all visible lines. Remember the lnum of the
|
|
||||||
* longest line, clostest to the cursor line. Used when scrolling
|
|
||||||
* below. */
|
|
||||||
max = 0;
|
|
||||||
for (lnum = curwin->w_topline; lnum < curwin->w_botline; ++lnum)
|
|
||||||
{
|
|
||||||
n = scroll_line_len(lnum);
|
|
||||||
if (n > (colnr_T)max)
|
|
||||||
{
|
|
||||||
max = n;
|
|
||||||
longest_lnum = lnum;
|
|
||||||
}
|
|
||||||
else if (n == (colnr_T)max
|
|
||||||
&& abs((int)(lnum - curwin->w_cursor.lnum))
|
|
||||||
< abs((int)(longest_lnum - curwin->w_cursor.lnum)))
|
|
||||||
longest_lnum = lnum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* Use cursor line only. */
|
|
||||||
max = scroll_line_len(curwin->w_cursor.lnum);
|
|
||||||
#ifdef FEAT_VIRTUALEDIT
|
#ifdef FEAT_VIRTUALEDIT
|
||||||
if (virtual_active())
|
if (virtual_active())
|
||||||
{
|
{
|
||||||
@ -4442,26 +4466,33 @@ gui_update_horiz_scrollbar(force)
|
|||||||
* Do a horizontal scroll. Return TRUE if the cursor moved, FALSE otherwise.
|
* Do a horizontal scroll. Return TRUE if the cursor moved, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
gui_do_horiz_scroll()
|
gui_do_horiz_scroll(leftcol, compute_longest_lnum)
|
||||||
|
colnr_T leftcol;
|
||||||
|
int compute_longest_lnum;
|
||||||
{
|
{
|
||||||
/* no wrapping, no scrolling */
|
/* no wrapping, no scrolling */
|
||||||
if (curwin->w_p_wrap)
|
if (curwin->w_p_wrap)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ((long_u)curwin->w_leftcol == scrollbar_value)
|
if (curwin->w_leftcol == leftcol)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
curwin->w_leftcol = (colnr_T)scrollbar_value;
|
curwin->w_leftcol = leftcol;
|
||||||
|
|
||||||
/* When the line of the cursor is too short, move the cursor to the
|
/* When the line of the cursor is too short, move the cursor to the
|
||||||
* longest visible line. Do a sanity check on "longest_lnum", just in
|
* longest visible line. */
|
||||||
* case. */
|
|
||||||
if (vim_strchr(p_go, GO_HORSCROLL) == NULL
|
if (vim_strchr(p_go, GO_HORSCROLL) == NULL
|
||||||
&& longest_lnum >= curwin->w_topline
|
&& !virtual_active()
|
||||||
&& longest_lnum < curwin->w_botline
|
&& leftcol > scroll_line_len(curwin->w_cursor.lnum))
|
||||||
&& !virtual_active())
|
|
||||||
{
|
{
|
||||||
if (scrollbar_value > (long_u)scroll_line_len(curwin->w_cursor.lnum))
|
if (compute_longest_lnum)
|
||||||
|
{
|
||||||
|
curwin->w_cursor.lnum = gui_find_longest_lnum();
|
||||||
|
curwin->w_cursor.col = 0;
|
||||||
|
}
|
||||||
|
/* Do a sanity check on "longest_lnum", just in case. */
|
||||||
|
else if (longest_lnum >= curwin->w_topline
|
||||||
|
&& longest_lnum < curwin->w_botline)
|
||||||
{
|
{
|
||||||
curwin->w_cursor.lnum = longest_lnum;
|
curwin->w_cursor.lnum = longest_lnum;
|
||||||
curwin->w_cursor.col = 0;
|
curwin->w_cursor.col = 0;
|
||||||
|
@ -1700,7 +1700,13 @@ scroll_event(GtkWidget *widget,
|
|||||||
case GDK_SCROLL_DOWN:
|
case GDK_SCROLL_DOWN:
|
||||||
button = MOUSE_5;
|
button = MOUSE_5;
|
||||||
break;
|
break;
|
||||||
default: /* We don't care about left and right... Yet. */
|
case GDK_SCROLL_LEFT:
|
||||||
|
button = MOUSE_7;
|
||||||
|
break;
|
||||||
|
case GDK_SCROLL_RIGHT:
|
||||||
|
button = MOUSE_6;
|
||||||
|
break;
|
||||||
|
default: /* This shouldn't happen */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,8 +228,13 @@ enum key_extra
|
|||||||
, KE_S_XF3
|
, KE_S_XF3
|
||||||
, KE_S_XF4
|
, KE_S_XF4
|
||||||
|
|
||||||
|
/* NOTE: The scroll wheel events are inverted: i.e. UP is the same as
|
||||||
|
* moving the actual scroll wheel down, LEFT is the same as moving the
|
||||||
|
* scroll wheel right. */
|
||||||
, KE_MOUSEDOWN /* scroll wheel pseudo-button Down */
|
, KE_MOUSEDOWN /* scroll wheel pseudo-button Down */
|
||||||
, KE_MOUSEUP /* scroll wheel pseudo-button Up */
|
, KE_MOUSEUP /* scroll wheel pseudo-button Up */
|
||||||
|
, KE_MOUSELEFT /* scroll wheel pseudo-button Left */
|
||||||
|
, KE_MOUSERIGHT /* scroll wheel pseudo-button Right */
|
||||||
|
|
||||||
, KE_KINS /* keypad Insert key */
|
, KE_KINS /* keypad Insert key */
|
||||||
, KE_KDEL /* keypad Delete key */
|
, KE_KDEL /* keypad Delete key */
|
||||||
@ -440,6 +445,8 @@ enum key_extra
|
|||||||
|
|
||||||
#define K_MOUSEDOWN TERMCAP2KEY(KS_EXTRA, KE_MOUSEDOWN)
|
#define K_MOUSEDOWN TERMCAP2KEY(KS_EXTRA, KE_MOUSEDOWN)
|
||||||
#define K_MOUSEUP TERMCAP2KEY(KS_EXTRA, KE_MOUSEUP)
|
#define K_MOUSEUP TERMCAP2KEY(KS_EXTRA, KE_MOUSEUP)
|
||||||
|
#define K_MOUSELEFT TERMCAP2KEY(KS_EXTRA, KE_MOUSELEFT)
|
||||||
|
#define K_MOUSERIGHT TERMCAP2KEY(KS_EXTRA, KE_MOUSERIGHT)
|
||||||
|
|
||||||
#define K_CSI TERMCAP2KEY(KS_EXTRA, KE_CSI)
|
#define K_CSI TERMCAP2KEY(KS_EXTRA, KE_CSI)
|
||||||
#define K_SNR TERMCAP2KEY(KS_EXTRA, KE_SNR)
|
#define K_SNR TERMCAP2KEY(KS_EXTRA, KE_SNR)
|
||||||
|
@ -987,6 +987,7 @@ wait_return(redraw)
|
|||||||
|| c == K_LEFTDRAG || c == K_LEFTRELEASE
|
|| c == K_LEFTDRAG || c == K_LEFTRELEASE
|
||||||
|| c == K_MIDDLEDRAG || c == K_MIDDLERELEASE
|
|| c == K_MIDDLEDRAG || c == K_MIDDLERELEASE
|
||||||
|| c == K_RIGHTDRAG || c == K_RIGHTRELEASE
|
|| c == K_RIGHTDRAG || c == K_RIGHTRELEASE
|
||||||
|
|| c == K_MOUSELEFT || c == K_MOUSERIGHT
|
||||||
|| c == K_MOUSEDOWN || c == K_MOUSEUP
|
|| c == K_MOUSEDOWN || c == K_MOUSEUP
|
||||||
|| (!mouse_has(MOUSE_RETURN)
|
|| (!mouse_has(MOUSE_RETURN)
|
||||||
&& mouse_row < msg_row
|
&& mouse_row < msg_row
|
||||||
|
@ -3158,6 +3158,8 @@ get_keystroke()
|
|||||||
|| n == K_RIGHTRELEASE
|
|| n == K_RIGHTRELEASE
|
||||||
|| n == K_MOUSEDOWN
|
|| n == K_MOUSEDOWN
|
||||||
|| n == K_MOUSEUP
|
|| n == K_MOUSEUP
|
||||||
|
|| n == K_MOUSELEFT
|
||||||
|
|| n == K_MOUSERIGHT
|
||||||
|| n == K_X1MOUSE
|
|| n == K_X1MOUSE
|
||||||
|| n == K_X1DRAG
|
|| n == K_X1DRAG
|
||||||
|| n == K_X1RELEASE
|
|| n == K_X1RELEASE
|
||||||
|
@ -2362,8 +2362,12 @@ static struct key_name_entry
|
|||||||
{K_RIGHTMOUSE, (char_u *)"RightMouse"},
|
{K_RIGHTMOUSE, (char_u *)"RightMouse"},
|
||||||
{K_RIGHTDRAG, (char_u *)"RightDrag"},
|
{K_RIGHTDRAG, (char_u *)"RightDrag"},
|
||||||
{K_RIGHTRELEASE, (char_u *)"RightRelease"},
|
{K_RIGHTRELEASE, (char_u *)"RightRelease"},
|
||||||
{K_MOUSEDOWN, (char_u *)"MouseDown"},
|
{K_MOUSEDOWN, (char_u *)"ScrollWheelUp"},
|
||||||
{K_MOUSEUP, (char_u *)"MouseUp"},
|
{K_MOUSEUP, (char_u *)"ScrollWheelDown"},
|
||||||
|
{K_MOUSELEFT, (char_u *)"ScrollWheelRight"},
|
||||||
|
{K_MOUSERIGHT, (char_u *)"ScrollWheelLeft"},
|
||||||
|
{K_MOUSEDOWN, (char_u *)"MouseDown"}, /* OBSOLETE: Use */
|
||||||
|
{K_MOUSEUP, (char_u *)"MouseUp"}, /* ScrollWheelXXX instead */
|
||||||
{K_X1MOUSE, (char_u *)"X1Mouse"},
|
{K_X1MOUSE, (char_u *)"X1Mouse"},
|
||||||
{K_X1DRAG, (char_u *)"X1Drag"},
|
{K_X1DRAG, (char_u *)"X1Drag"},
|
||||||
{K_X1RELEASE, (char_u *)"X1Release"},
|
{K_X1RELEASE, (char_u *)"X1Release"},
|
||||||
|
33
src/normal.c
33
src/normal.c
@ -368,8 +368,10 @@ static const struct nv_cmd
|
|||||||
/* pound sign */
|
/* pound sign */
|
||||||
{POUND, nv_ident, 0, 0},
|
{POUND, nv_ident, 0, 0},
|
||||||
#ifdef FEAT_MOUSE
|
#ifdef FEAT_MOUSE
|
||||||
{K_MOUSEUP, nv_mousescroll, 0, TRUE},
|
{K_MOUSEUP, nv_mousescroll, 0, MSCR_UP},
|
||||||
{K_MOUSEDOWN, nv_mousescroll, 0, FALSE},
|
{K_MOUSEDOWN, nv_mousescroll, 0, MSCR_DOWN},
|
||||||
|
{K_MOUSELEFT, nv_mousescroll, 0, MSCR_LEFT},
|
||||||
|
{K_MOUSERIGHT, nv_mousescroll, 0, MSCR_RIGHT},
|
||||||
{K_LEFTMOUSE, nv_mouse, 0, 0},
|
{K_LEFTMOUSE, nv_mouse, 0, 0},
|
||||||
{K_LEFTMOUSE_NM, nv_mouse, 0, 0},
|
{K_LEFTMOUSE_NM, nv_mouse, 0, 0},
|
||||||
{K_LEFTDRAG, nv_mouse, 0, 0},
|
{K_LEFTDRAG, nv_mouse, 0, 0},
|
||||||
@ -3861,7 +3863,7 @@ add_to_showcmd(c)
|
|||||||
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
|
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
|
||||||
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
|
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
|
||||||
K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
|
K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
|
||||||
K_MOUSEDOWN, K_MOUSEUP,
|
K_MOUSEDOWN, K_MOUSEUP, K_MOUSELEFT, K_MOUSERIGHT,
|
||||||
K_X1MOUSE, K_X1DRAG, K_X1RELEASE, K_X2MOUSE, K_X2DRAG, K_X2RELEASE,
|
K_X1MOUSE, K_X1DRAG, K_X1RELEASE, K_X2MOUSE, K_X2DRAG, K_X2RELEASE,
|
||||||
K_CURSORHOLD,
|
K_CURSORHOLD,
|
||||||
0
|
0
|
||||||
@ -4536,7 +4538,8 @@ nv_screengo(oap, dir, dist)
|
|||||||
/*
|
/*
|
||||||
* Mouse scroll wheel: Default action is to scroll three lines, or one page
|
* Mouse scroll wheel: Default action is to scroll three lines, or one page
|
||||||
* when Shift or Ctrl is used.
|
* when Shift or Ctrl is used.
|
||||||
* K_MOUSEUP (cap->arg == TRUE) or K_MOUSEDOWN (cap->arg == FALSE)
|
* K_MOUSEUP (cap->arg == 1) or K_MOUSEDOWN (cap->arg == 0) or
|
||||||
|
* K_MOUSELEFT (cap->arg == -1) or K_MOUSERIGHT (cap->arg == -2)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
nv_mousescroll(cap)
|
nv_mousescroll(cap)
|
||||||
@ -4559,6 +4562,8 @@ nv_mousescroll(cap)
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
|
||||||
|
{
|
||||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||||
{
|
{
|
||||||
(void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
|
(void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
|
||||||
@ -4569,6 +4574,24 @@ nv_mousescroll(cap)
|
|||||||
cap->count0 = 3;
|
cap->count0 = 3;
|
||||||
nv_scroll_line(cap);
|
nv_scroll_line(cap);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
# ifdef FEAT_GUI
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Horizontal scroll - only allowed when 'wrap' is disabled */
|
||||||
|
if (!curwin->w_p_wrap)
|
||||||
|
{
|
||||||
|
int val, step = 6;
|
||||||
|
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||||
|
step = W_WIDTH(curwin);
|
||||||
|
val = curwin->w_leftcol + (cap->arg == MSCR_RIGHT ? -step : +step);
|
||||||
|
if (val < 0)
|
||||||
|
val = 0;
|
||||||
|
|
||||||
|
gui_do_horiz_scroll(val, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
# if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
|
# if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
|
||||||
curwin->w_redr_status = TRUE;
|
curwin->w_redr_status = TRUE;
|
||||||
@ -5166,7 +5189,7 @@ nv_hor_scrollbar(cap)
|
|||||||
clearopbeep(cap->oap);
|
clearopbeep(cap->oap);
|
||||||
|
|
||||||
/* Even if an operator was pending, we still want to scroll */
|
/* Even if an operator was pending, we still want to scroll */
|
||||||
gui_do_horiz_scroll();
|
gui_do_horiz_scroll(scrollbar_value, FALSE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ void gui_drag_scrollbar __ARGS((scrollbar_T *sb, long value, int still_dragging)
|
|||||||
void gui_may_update_scrollbars __ARGS((void));
|
void gui_may_update_scrollbars __ARGS((void));
|
||||||
void gui_update_scrollbars __ARGS((int force));
|
void gui_update_scrollbars __ARGS((int force));
|
||||||
int gui_do_scroll __ARGS((void));
|
int gui_do_scroll __ARGS((void));
|
||||||
int gui_do_horiz_scroll __ARGS((void));
|
int gui_do_horiz_scroll __ARGS((colnr_T leftcol, int compute_longest_lnum));
|
||||||
void gui_check_colors __ARGS((void));
|
void gui_check_colors __ARGS((void));
|
||||||
guicolor_T gui_get_color __ARGS((char_u *name));
|
guicolor_T gui_get_color __ARGS((char_u *name));
|
||||||
int gui_get_lightness __ARGS((guicolor_T pixel));
|
int gui_get_lightness __ARGS((guicolor_T pixel));
|
||||||
|
@ -4167,6 +4167,8 @@ check_termcode(max_offset, buf, buflen)
|
|||||||
&& key_name[0] == (int)KS_EXTRA
|
&& key_name[0] == (int)KS_EXTRA
|
||||||
&& (key_name[1] == (int)KE_X1MOUSE
|
&& (key_name[1] == (int)KE_X1MOUSE
|
||||||
|| key_name[1] == (int)KE_X2MOUSE
|
|| key_name[1] == (int)KE_X2MOUSE
|
||||||
|
|| key_name[1] == (int)KE_MOUSELEFT
|
||||||
|
|| key_name[1] == (int)KE_MOUSERIGHT
|
||||||
|| key_name[1] == (int)KE_MOUSEDOWN
|
|| key_name[1] == (int)KE_MOUSEDOWN
|
||||||
|| key_name[1] == (int)KE_MOUSEUP))
|
|| key_name[1] == (int)KE_MOUSEUP))
|
||||||
{
|
{
|
||||||
@ -5054,7 +5056,7 @@ replace_termcodes(from, bufp, from_part, do_lt, special)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* If 'cpoptions' does not contain '<', check for special key codes,
|
* If 'cpoptions' does not contain '<', check for special key codes,
|
||||||
* like "<C-S-MouseLeft>"
|
* like "<C-S-LeftMouse>"
|
||||||
*/
|
*/
|
||||||
if (do_special && (do_lt || STRNCMP(src, "<lt>", 4) != 0))
|
if (do_special && (do_lt || STRNCMP(src, "<lt>", 4) != 0))
|
||||||
{
|
{
|
||||||
|
12
src/vim.h
12
src/vim.h
@ -1721,12 +1721,18 @@ typedef int proftime_T; /* dummy for function prototypes */
|
|||||||
# define MOUSE_CTRL 0x10
|
# define MOUSE_CTRL 0x10
|
||||||
|
|
||||||
/* mouse buttons that are handled like a key press (GUI only) */
|
/* mouse buttons that are handled like a key press (GUI only) */
|
||||||
|
/* Note that the scroll wheel keys are inverted: MOUSE_5 scrolls lines up but
|
||||||
|
* the result of this is that the window moves down, similarly MOUSE_6 scrolls
|
||||||
|
* columns left but the window moves right. */
|
||||||
# define MOUSE_4 0x100 /* scroll wheel down */
|
# define MOUSE_4 0x100 /* scroll wheel down */
|
||||||
# define MOUSE_5 0x200 /* scroll wheel up */
|
# define MOUSE_5 0x200 /* scroll wheel up */
|
||||||
|
|
||||||
# define MOUSE_X1 0x300 /* Mouse-button X1 (6th) */
|
# define MOUSE_X1 0x300 /* Mouse-button X1 (6th) */
|
||||||
# define MOUSE_X2 0x400 /* Mouse-button X2 */
|
# define MOUSE_X2 0x400 /* Mouse-button X2 */
|
||||||
|
|
||||||
|
# define MOUSE_6 0x500 /* scroll wheel left */
|
||||||
|
# define MOUSE_7 0x600 /* scroll wheel right */
|
||||||
|
|
||||||
/* 0x20 is reserved by xterm */
|
/* 0x20 is reserved by xterm */
|
||||||
# define MOUSE_DRAG_XTERM 0x40
|
# define MOUSE_DRAG_XTERM 0x40
|
||||||
|
|
||||||
@ -2180,4 +2186,10 @@ typedef int VimClipboard; /* This is required for the prototypes. */
|
|||||||
#define BFA_WIPE 2 /* buffer is going to be wiped out */
|
#define BFA_WIPE 2 /* buffer is going to be wiped out */
|
||||||
#define BFA_KEEP_UNDO 4 /* do not free undo information */
|
#define BFA_KEEP_UNDO 4 /* do not free undo information */
|
||||||
|
|
||||||
|
/* direction for nv_mousescroll() and ins_mousescroll() */
|
||||||
|
#define MSCR_DOWN 0 /* DOWN must be FALSE */
|
||||||
|
#define MSCR_UP 1
|
||||||
|
#define MSCR_LEFT -1
|
||||||
|
#define MSCR_RIGHT -2
|
||||||
|
|
||||||
#endif /* VIM__H */
|
#endif /* VIM__H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user