tested in both the old command prompt conhost.exe as well as the new windows terminal wt.exe
https://github.com/vim/vim/pull/11374
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Merging #11374 (03ba5af) into master (4ccaedf) will decrease coverage by
81.57%.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #11374 +/- ## =========================================== - Coverage 81.87% 0.29% -81.58% =========================================== Files 162 152 -10 Lines 189365 175086 -14279 Branches 43071 40295 -2776 =========================================== - Hits 155041 520 -154521 - Misses 21770 174509 +152739 + Partials 12554 57 -12497
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | ? |
|
| huge-gcc-none | ? |
|
| huge-gcc-testgui | ? |
|
| huge-gcc-unittests | 0.29% <ø> (ø) |
|
| linux | 0.29% <ø> (-82.25%) |
⬇️ |
| mingw-x64-HUGE | ? |
|
| mingw-x86-HUGE | ? |
|
| windows | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/float.c | 0.00% <0.00%> (-98.42%) |
⬇️ |
| src/sha256.c | 0.00% <0.00%> (-96.45%) |
⬇️ |
| src/gui_gtk_f.c | 0.00% <0.00%> (-94.72%) |
⬇️ |
| src/arabic.c | 0.00% <0.00%> (-94.57%) |
⬇️ |
| src/crypt_zip.c | 0.00% <0.00%> (-94.12%) |
⬇️ |
| src/testing.c | 0.00% <0.00%> (-93.84%) |
⬇️ |
| src/typval.c | 0.00% <0.00%> (-93.26%) |
⬇️ |
| src/blob.c | 0.00% <0.00%> (-92.63%) |
⬇️ |
| src/debugger.c | 0.00% <0.00%> (-92.31%) |
⬇️ |
| src/eval.c | 0.00% <0.00%> (-92.18%) |
⬇️ |
| ... and 146 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks for working on this. It might be too much to ask, but would it be possible to add a test for this? About the changes to .gitignore: Where does "/vim90/" come from? Is "/src/.vscode/" something that is created when building Vim with Visual Studio? Please check the code formatting, it doesn't look like it's using Vim style everywhere.
Thanks for taking the time to review my suggestion. I'm happy to get involved. I can look into writing some tests, but not sure if the existing automated test tools can capture what is going in - will find out.
The .gitignore changes are unimportant for the issue. The vim90 directory is just where my build scripts create my installer package, before deploying it to my Program FIles, and the .vscode directory is just from the tooling of Visual Studio Code. Let me know if its not worth sharing, and I think I can move these ignores out.
Sorry about the formatting, it looked different in Visual Studio Code (tabs and spaces have changed). I tried to follow the existing style in the source code. I havent seen the VIm style guide, but I will look it up, and am happy to clean it up.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@k-takata commented on this pull request.
Please also fix the indentation as already mentioned.
In src/os_win32.c:
> + static void +decode_mouse_wheel( MOUSE_EVENT_RECORD *pmer )⬇️ Suggested change
- static void -decode_mouse_wheel( MOUSE_EVENT_RECORD *pmer ) + static void +decode_mouse_wheel(MOUSE_EVENT_RECORD *pmer)
In src/os_win32.c:
> + int l_col;
+ int l_row;
+ l_col = g_xMouse;
+ l_row = g_yMouse;
+ wp = mouse_find_win(&l_row, &l_col, FAIL_POPUP);
+ if (wp != NULL && popup_is_popup(wp))
+ {
+ g_nMouseClick = -1;
+
+ cmdarg_T cap;
+ oparg_T oa;
+ CLEAR_FIELD(cap);
+ clear_oparg(&oa);
+ cap.oap = &oa;
+
+ if ( horizontal )
⬇️ Suggested change
- if ( horizontal ) + if (horizontal)
In src/os_win32.c:
> + if (horizontal) + direction = zDelta >= 0 ? KE_MOUSELEFT : KE_MOUSERIGHT; + else + direction = zDelta >= 0 ? KE_MOUSEDOWN : KE_MOUSEUP; + + + // Decode the win32 console key modifers into Vim mouse modifers. + if (pmer->dwControlKeyState & SHIFT_PRESSED) + modifiers |= MOD_MASK_SHIFT; //MOUSE_SHIFT; + if (pmer->dwControlKeyState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)) + modifiers |= MOD_MASK_CTRL; //MOUSE_CTRL; + if (pmer->dwControlKeyState & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED)) + modifiers |= MOD_MASK_ALT; // MOUSE_ALT; + + // add (bitwise or) the scroll direction and the key modifier chars together. + g_nMouseClick = ( (direction << 8) | modifiers );⬇️ Suggested change
- g_nMouseClick = ( (direction << 8) | modifiers ); + g_nMouseClick = ((direction << 8) | modifiers);
In src/os_win32.c:
> @@ -1303,9 +1402,15 @@ decode_mouse_event(
// unprocessed mouse click?
if (g_nMouseClick != -1)
return TRUE;
+
+ if (pmer->dwEventFlags == MOUSE_WHEELED || pmer->dwEventFlags == MOUSE_HWHEELED )
⬇️ Suggested change
- if (pmer->dwEventFlags == MOUSE_WHEELED || pmer->dwEventFlags == MOUSE_HWHEELED ) + if (pmer->dwEventFlags == MOUSE_WHEELED || pmer->dwEventFlags == MOUSE_HWHEELED)
In src/os_win32.c:
> @@ -1939,12 +2044,37 @@ mch_inchar(
fprintf(fdDump, "{%02x @ %d, %d}",
g_nMouseClick, g_xMouse, g_yMouse);
# endif
- typeahead[typeaheadlen++] = ESC + 128;
- typeahead[typeaheadlen++] = 'M';
- typeahead[typeaheadlen++] = g_nMouseClick;
- typeahead[typeaheadlen++] = g_xMouse + '!';
- typeahead[typeaheadlen++] = g_yMouse + '!';
- g_nMouseClick = -1;
+ char_u modifiers = ((char_u *)(&g_nMouseClick))[0];
+ char_u scroll_dir = ((char_u *)(&g_nMouseClick))[1];
+
+ if( scroll_dir > 0
⬇️ Suggested change
- if( scroll_dir > 0 + if (scroll_dir > 0
In src/os_win32.c:
> + scroll_dir==KE_MOUSEDOWN || + scroll_dir==KE_MOUSEUP || + scroll_dir==KE_MOUSELEFT || + scroll_dir==KE_MOUSERIGHT )⬇️ Suggested change
- scroll_dir==KE_MOUSEDOWN || - scroll_dir==KE_MOUSEUP || - scroll_dir==KE_MOUSELEFT || - scroll_dir==KE_MOUSERIGHT ) + scroll_dir == KE_MOUSEDOWN || + scroll_dir == KE_MOUSEUP || + scroll_dir == KE_MOUSELEFT || + scroll_dir == KE_MOUSERIGHT)
In src/os_win32.c:
> - typeahead[typeaheadlen++] = g_nMouseClick;
- typeahead[typeaheadlen++] = g_xMouse + '!';
- typeahead[typeaheadlen++] = g_yMouse + '!';
- g_nMouseClick = -1;
+ char_u modifiers = ((char_u *)(&g_nMouseClick))[0];
+ char_u scroll_dir = ((char_u *)(&g_nMouseClick))[1];
+
+ if( scroll_dir > 0
+ && (
+ scroll_dir==KE_MOUSEDOWN ||
+ scroll_dir==KE_MOUSEUP ||
+ scroll_dir==KE_MOUSELEFT ||
+ scroll_dir==KE_MOUSERIGHT )
+ )
+ {
+ if ( modifiers > 0 )
⬇️ Suggested change
- if ( modifiers > 0 ) + if (modifiers > 0)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@zewpo pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
thanks @k-takata
this is great help for me learning how it should be.
quick question, are tabs normally viewed as 4 spaces or 8 spaces. I think that caused me some confusion too. Is it OK, if I change most of the tabs to actual spaces in this file os_win32.c? I think that will help prevent that sort of confusion in the future.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
The .vscode directory seems like something common, that others would also run into. The vim90 directory seems to be specific for your tools, thus I would not include that.
Oh, hang on, I should explain why I did it. It wasn't simply arbitrary for my tools. It actually comes from me following the general instructions supplied in ./src/INSTALLpc.txt. See section 17.
- Installing after building from sources
==========================================
...
Go to the directory that contains the Vim "src" and "runtime"
directories and create a new subdirectory named "vim82".
...
I just updated the directory name from vim82 to vim90 in my script. I think it might be useful for others also. Is it OK?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks @k-takata
this is great help for me learning how it should be.
quick question, are tabs normally viewed as 4 spaces or 8 spaces. I think that caused me some confusion too. Is it OK, if I change most of the tabs to actual spaces in this file os_win32.c? I think that will help prevent that sort of confusion in the future.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I've had a look into writing some tests for this. But, I cant find any existing functioning test scripts to work with mouse handling in the windows terminal. There is some termcode testing, but for unix only, although that seems to come close to what would be useful here. Making it work on windows is a lot bigger than just adding the scroll feature, so can this testing be done in a separate issue apart from this pull request?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@zewpo commented on this pull request.
ready for review again, I think.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
actually not sure how many people like me tried much ways to temp disable the mouse (or specific to 'touchpad' of laptop) scrolling when in vim (and auto enabled when focus left vim), which would interrupt or miss-typing when editing in vim, e.g sometimes your hand miss touch the touchpad.
but so far au focusgain/foucslost (and others ways) seems did not work perfectly.
alternatively if there is a direct vim option to auto disable touchpad scrolling in vim would be great. <---------------
// NOTE: it is specific to touchpad 'scrolling', since tap to click or corner button can be disable by tb setting itself, vs scrolling probably is needed when Not in vim.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Just checking if I understand correctly - and how it relates to this particular PR.
Do you mean to suggest that it would be great if we added a new feature to allow disabling mouse wheel scrolling in non-win32 TUI consoles?
Or, do you see a potential problem occuring now on win32 TUI consoles being caused caused by this PR? Since win32 TUI consoles never previously had scrolling, and enabling it may cause new issues?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
This pr only effects win32 tui consoles, it brings them inline with other tui consoles.
Disabling the mouse in vim is available already,
set mouse=
in your rc file,
For more info;
:help 'mouse'
Does that answer your question, and does it actually work for you?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
note: i mean just when in vim, that 'option' just to disable mouse/touchpad scrolling in vim, but not system/os level mouse/touchpad scrolling.
since when switched out of vim e.g by alt-tab and/or checking pages in firefox, then mouse/touchpad scrolling is needed.
// so far by some tricky setting e.g by au foucusgained/foucuslost can mock this, but the foucs event is system level of windows' manger, not always worked perfectly.
// manually set mouse= or something like that is not a good solution, since users had to switched it everytime.
i knew your/this pr is just for win32 tui consoles, but if you can adding an option to disable it (let user to choose) as well as others tui consoles would be great.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
setting the set mouse= is permanent when you do it in your vimrc file.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
set mouse= worked for pure xterm(372), but unfortunately not worked for e.g xfce-term.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Thats interesting, I just expected it was meant to work everywhere. You may have found a bug - and it might be worth creating a new issue for it - let me know if you create one. I'm happy to test it out and provide some help if I can. I am just installing xfce-xterm now to have a look :) but also FYI, I'm very, very new to developing in VIm codebase. This PR was me just dipping my toes into it for the very first time, so there probably are others who are more knowledgable than I am.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
haha. that's ok, this just a wish, and probably was a knew issue.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
its cool @Shane-XB-Qian I think its interesting.
I just did some quick testing, and found strange behaviour in the following console applications; XTerm(374), the new Windows Terminal, and in Alacritty. When mouse=(blank) then the terminal scrolls back, which is probably not good.
But it works properly as I would hope on Kitty 0.26.3, xfce4-terminal 1.0.4 (Xfce 4.16), and in the old windows conhost.exe.
Its all a bit weird.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Alternatively you can map <ScrollWheelUp> and <ScrollWheelDown> to <Nop> while still enabling mouse.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
cool, if you can dig into it would be great.
xfce4-terminal 0.8.10 (Xfce 4.16)
terminator 2.1.1
// above two did not work.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
yes, that seems to solve it in all of my linux terminals.
doesnt seem to work in my windows terminals
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
I just checked @zeertzjq suggestion. It solves it for terminator on my system also. (terminator 2.1.1)
map <ScrollWheelUp> <Nop>
map <ScrollWheelDown> <Nop>
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
yes, i tried too, but that's tricky, and not only map, but also imap etc....
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
I think that map covers all the [X]map modes.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
nope, if only map (but no imap etc) it still can scroll in such mode (e.g insert mode).
// unless just set mouse=n
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
OK, I see now. probably want both map and map! to cover all modes, I think.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
for a workaround, looks 'yes', but issue still there anyway... :-)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
IF that's better (vs mouse=), then it's ok.
anyway, i thought this is a very common demand if you are using vim in a laptop which had a touchpad. :-)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
but if saying a wish, then actually wish mouse= can really disable mouse/touchpad in all tui consoles,
since actually not only scroll, but e.g click would interrupt typing (by miss touching the touchpad) when in vim also.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Shane, thanks for sharing your wish, it has revealed an issue with my patch - it doesnt handle mappings of scrollwheel, but everywhere else, the mappings seems to work as expected.
@brammool
My patch uses gui CSI codes to implement the mouse scroll event in the windows console, and that worked for scrolling the various vim_windows, but, I now see that any "mappings" for gui CSI events aren't matched the same way in the windows console as they are in the gui. When the compilation includes the gui, the mappings arent found if the "gui.in_use" is false - and scrolling just scrolls regardless of the mapping.
But, it gets even worse, when the dll is not included in the compilation, my patch then causes MouseScroll events to send spurious codes into the windows console, that arent handled at all and it just looks like bizarred characters are being keyed into the console. So thats a bug that I introduced. I'm having a go at investigating why this is the case. The various combinations of gui/dll/terminal-only makes getchar behave differentlly in the different windows based version. There is some legacy issues there for me to wrap my head around - but thats OK because I have time to work it out.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
ok, but i felt such mappings (while mouse=nvi) in insert mode with popup compl memu is visible, still would kick off click and/or scroll events (which would interrupt compl), though i donot know how to privide MRE.
// so i wish/felt just to make mouse=(black) would be more correct way.
// but anyway, those should be not your pr made it, vs was existing issue.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
my feeling on that suggestion, @Shane-XB-Qian is that I would guess mouse=(blank) already has an expected behaviour. Because, I think it already means that mouse events are not swallowed by vim, and are instead left for the outer host console to decide what to do with them.
So, I imagine that we would want an explicit setting for vim to swallow all mouse events. But, as pointed out, we can already do all the mappings explicitly. That "should" work everywhere. To simplify this for users, perhaps vim could include a mouse-off vim script (that just has all the MouseScroll events mapped to ), and then that can simply be sourced with one line in your vimrc to call that if you want.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
after mouse=nvi and above such mappings, seems looks fine except when popup compl menu is visible.
// at least so far i only noticed such one case.
i cannot provide the MRE, but following log:
1, the first line is when popup compl menu is visible, see -- Keyword completion (^N^P) The only match
2, then use your single finger press the laptop touchpad move a little (to kick of scroll)
3, the last line is: such scroll interrupt compl, see -- INSERT --
// i donot know how to mock the case further, but somehow the click and/or scroll interrupt compl still.
// i tried xterm(372) and xfce-term same.
8.937521 : raw terminal output: "�[36;8H�[97m�[48;5;242m pos1�[m�[1m�[32m�[40m �[m��[97m�[48;5;242m �[m�[70;1H�[1m-- Keyword completion (^N^P) The only match�[35;13H�[m�[2;9H�[48;5;237m �[m �[3;9H�[93m�[48;5;237ma�[m�[2C �[4;9H�[48;5;237m �[m �[5;9H�[93m�[48;5;237mr�[m�[2C(�[6;9H�[95m�[48;5;237m"�[m�[2C�[95mf�[m�[7;9H�[95m�[48;5;237m"�[m�[2C�[95mt�[m�[8;9H�[95m�[48;5;237m"�[m�[2C�[95mn�[m�[9;9H�[95m�[48;5;237m"�[m�[2C�[95ma�[m�[10;9H�[95m�[48;5;237m"�[m�[2C�[95mt�[m�[11;9H�[95m�[48;5;237m"�[m�[2C�[95m"�[m�[12;9H�[95m�[48;5;237m"�[m�[2C�[95m/�[m�[13;9H�[95m�[48;5;237m"�[m�[2C�[95mt�[m�[14;9H�[95m�[48;5;237m"�[m�[2C�[95mg�[m�[15;9H�[95m�[48;5;237m"�[m�[2C�[95mn�[m�[16;9H�[95m�[48;5;237m"�[m�[2C�[95mr�[m�[17;9H�[95m�[48;5;237m"�[m�[2C�[95mr�[m�[18;9H�[95m�[48;5;237m"�[m�[2C�[95mn�[m�[19;9H�[95m�[48;5;237m"�[m�[2C�[95mm�[m�[20;9H�[48;5;237m �[m �[21;9H�[95m�[48;5;237m"�[m�[2C�[95mt�[m�[22;9H�[95m�[48;5;237m"�[m�[2C�[95mt�[m�[23;9H�[95m�[48;5;237m"�[m�[2C�[95mt�[m�[24;9H�[95m�[48;5;237m"�[m�[2C�[95mt�[m�[25;9H�[48;5;237m �[m �[26;9H�[48;5;237m �[m �[27;9H�[93m�[48;5;237mt�[m�[2C�[38;5;224ma�[m�[28;9H�[48;5;237m �[m �[29;9H�[93m�[48;5;237mt�[m�[2C�[38;5;224me�[m�[30;9H�[48;5;237m �[m �[31;9H�[38;5;224m�[48;5;237mr�[m�[2C�[38;5;224mi�[m�[32;9H�[48;5;237m �[m �[33;9H�[48;5;237m �[m�[2C�[38;5;121mt�[m�[34;9H�[48;5;237mn�[mame�[37;9H�[48;5;237ms�[mele�[38;9H�[48;5;237mi�[mnde�[39;9H�[48;5;237m �[m �[40;9H�[48;5;237m �[m �[41;9H�[38;5;225m�[48;5;237m(�[m �[42;9H�[38;5;224m�[48;5;237mc�[m�[2C�[38;5;240m-�[m�[43;9H�[38;5;224m�[48;5;237mr�[m�[2C�[38;5;224mt�[m�[44;9H�[38;5;224m�[48;5;237mi�[m�[2C�[38;5;224mu�[m�[45;9H�[48;5;237mf�[mile�[46;9H�[38;5;224m�[48;5;237ms�[m�[2C�[38;5;224me�[m�[47;9H�[38;5;224m�[48;5;237mh�[m�[2C�[38;5;224md�[m�[48;9H�[48;5;237mc�[murr�[49;9H�[48;5;237mc�[murs�[50;9H�[48;5;237mo�[mffs�[51;9H�[48;5;237mw�[midt�[52;9H�[48;5;237mm�[mute�[53;9H�[38;5;224m�[48;5;237md�[m�[2C�[38;5;224mt�[m�[54;9H�[38;5;224m�[48;5;237md�[m�[2C�[38;5;224ma"
8.939039 : setting timeout timer to 2 sec 0 nsec
8.944189 : setting timeout timer to 2 sec 0 nsec
8.944727 : setting timeout timer to 0 sec 60000000 nsec
8.946067 : raw terminal output: "�[m�[55;9H�[48;5;237mt�[mime�[56;9H�[38;5;224m�[48;5;237ms�[m�[2C�[38;5;224mn�[m�[57;9H�[48;5;237mi�[mgno�[58;9H�[48;5;237mf�[muzz�[59;9H�[48;5;237md�[mirO�[60;9H�[48;5;237mc�[murO�[61;9H�[48;5;237mm�[mruH�[62;9H�[48;5;237m �[m �[63;9H�[48;5;237m �[m �[64;9H�[93m�[48;5;237mt�[m�[2C �[65;9H�[38;5;224m�[48;5;237mm�[m�[2C�[38;5;224mM�[m�[66;9H�[38;5;224m�[48;5;237mm�[m�[2C�[38;5;224mS�[m�[67;9H�[38;5;224m�[48;5;237mm�[m�[2C�[38;5;224mT�[m�[69;94H�[1m�[97m�[41m[+] �[m�[30m�[42m [-][sy:ss:?] [Git(master)] [lsp:Y(r):A(t)]�[77C5-v2][0x70�[m�[36;8H�[1m�[32m�[40m pos1 �[35;13H�[?25h"
8.946073 : looking for messages on channels
10.071636 : raw key input: "�[<35;154;60M"
10.078325 : raw key input: "�[<35;154;60M"
10.079104 : setting timeout timer to 2 sec 0 nsec
10.083328 : raw terminal output: "�[?25l�[m�[70;1H
�[1m-- INSERT --�[m�[69;218H�[30m�[42m9-v6][0x2�[m�[2;9H �[48;5;237m �[m�[3;9H�[93ma�[m�[3C�[48;5;237mm�[m�[4;9H �[48;5;237m �[m�[5;9H�[93mr�[m�[3C�[48;5;237m �[m�[6;9H�[95m"�[m�[3C�[95m�[48;5;237mi�[m�[7;9H�[95m"�[m�[3C�[95m�[48;5;237me�[m�[8;9H�[95m"�[m�[3C�[95m�[48;5;237mt�[m�[9;9H�[95m"�[m�[3C�[95m�[48;5;237mg�[m�[10;9H�[95m"�[m�[3C�[95m�[48;5;237m"�[m�[11;9H�[95m"�[m�[3C�[48;5;237m �[m�[12;9H�[95m"�[m�[3C�[95m�[48;5;237me�[m�[13;9H�[95m"�[m�[3C�[95m�[48;5;237mh�[m�[14;9H�[95m"�[m�[3C�[95m�[48;5;237me�[m�[15;9H�[95m"�[m�[3C�[95m�[48;5;237mt�[m�[16;9H�[95m"�[m�[3C�[95m�[48;5;237mt�[m�[17;9H�[95m"�[m�[3C�[95m�[48;5;237mi�[m�[18;9H�[95m"�[m�[3C�[95m�[48;5;237mc�[m�[19;9H�[95m"�[m�[3C�[95m�[48;5;237me�[m�[20;9H �[48;5;237m �[m�[21;9H�[95m"�[m�[3C�[95m�[48;5;237mh�[m�[22;9H�[95m"�[m�[3C�[95m�[48;5;237mh�[m�[23;9H�[95m"�[m�[3C�[95m�[48;5;237mh�[m�[24;9H�[95m"�[m�[3C�[95m�[48;5;237mh�[m�[25;9H �[48;5;237m �[m�[26;9H �[48;5;237m �[m�[27;9H�[93mt�[m�[3C�[38;5;224m�[48;5;237mm�[m�[28;9H �[48;5;237m �[m�[29;9H�[93mt�[m�[3C�[38;5;224m�[48;5;237mr�[m�[30;9H �[48;5;237m �[m�[31;9H�[38;5;224mr�[m�[3C�[38;5;224m�[48;5;237ms�[m�[32;9H �[48;5;237m �[m�[33;9H �[3C�[38;5;121m�[48;5;237mc�[m�[34;9Hname�[38;5;240m�[48;5;237m-�[m�[36;8H�[38;5;240m-�[mpos2�[38;5;240m�[48;5;237m-�[m�[38;5;240m--+-�[m�[38;5;121mint�[m �[37;9Hsele�[48;5;237mc�[m�[38;9Hinde�[48;5;237mx�[m�[39;9H �[48;5;237m �[m�[40;9H �[48;5;237m �[m�[41;9H�[38;5;225m(�[m �[48;5;237m �[m�[42;9H�[38;5;224mc�[m�[3C�[38;5;240m�[48;5;237m-�[m�[43;9H�[38;5;224mr�[m�[3C�[38;5;240m�[48;5;237m-�[m�[44;9H�[38;5;224mi�[m�[3C�[38;5;224m�[48;5;237mt�[m�[45;9Hfile�[48;5;237ms�[m�[46;9H�[38;5;224ms�[m�[3C�[38;5;224m�[48;5;237mc�[m�[47;9H�[38;5;224mh�[m�[3C�[38;5;224m�[48;5;237mi�[m�[48;9Hcurr�[48;5;237me�[m�[49;9Hcurs�[48;5;237mo�[m�[50;9Hoffs�[48;5;237me�[m�[51;9Hwidt�[48;5;237mh�[m�[52;9Hmute�[48;5;237mx�[m�[53;9H"
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.![]()
@zewpo I want to ask, vertical scrolling works just fine, but what about horizontal scrolling? If I correctly remember, the Windows terminal API also correctly reports events for horizontal scrolling and the PR you have created already somehow processes also horizontal scrolling in the decode_mouse_wheel() function.
But it doesn't work, I have a mouse with a horizontal wheel and we can enable word wrapping using set wrap / set nowrap vim commands.
Would be possible to fix the horizontal scrolling? If yes, it could be also mapped to the ALT+mouse up/down.
Current behavior:
ctrl+mouse up/down - is scrolling by pageshift+mouse up/down - is scrolling terminal screen buffer instead of vim screen bufferalt+mouse up/down - does nothing, so it's free to use?—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@silverqx
Horizontal scrolling works fine in the old command prompt console. But, the new windows terminal console doesnt seem to pass through the horizontal events, as far as I can tell. I wrote a basic c program to simply catch input events, and print them to the screen - to try and test it out, it didnt work for horizontal mouse scroll events. See attached, let me know if you can test it on your windows terminal.
events.c.zip
With regards to mapping, I didnt get any mapping to be recognised if they included a modifier in them, so still some work to do on that end also. Vim recognises ctrl-scroll - as you mentioned, but if you try and create a custom mapping in your vim settings to map <ctrl-?scroll?> to do something else, it doesnt seem to work, and it just keeps scrolling.
basic mapping is working but not with modifier key <modifier-?scroll?>, so its incomplete there.
I think your shift+scroll is working because windows terminal has a keybinding to do that, rather than viming doing anything with it.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
You are right, wterm doesn't handle horizontal scrolling correctly, I have tried your event.c (amazing 😁 test code).
The alt+mouse up/down was only a fast idea, it doesn't matter much.
cmd console correctly reports horizontal events using your event.c, but doesn't work for me in vim using the horizontal mouse scroll wheel, I have also tried to disable the Quick edit mode, I don't know why it doesn't work. It can also interfere with another cmd setting.
Anyway if it doesn't work in the wterm it doesn't matter much, because who will use cmd these days when we have wterm 😁, vertical scrolling is enough, horizontal is not so important.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.![]()
@silverqx hah, its a bit wierd.
Thanks again for the feedback. So, it turns out that the horizontal mouse scrolling only works in any console when VIm is compiled with GUI=yes flag configured.
Just checking if its a MS Windows only "feature", but its not. Same thing happens on linux. This behavior comes from the generic mouse.c code. So, even on linux, when Vim version says something like; "...version without GUI...", then horizontal mouse scroll doesnt work. And then, when for "...version with ... GUI", horizontal scrolling works in the console as well as the gui.
So, we can make it work without the gui, with some refactoring of the mouse and gui_ code. If I do that, it will impact more than just MS Windows. So, just being super careful at the moment, dipping my toes in as carefully as I can, since I'm a noob as a vim contributor.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
perhaps you mean <MouseMove> (and mousemoveevent), that always is false if vim in tui terminal.
// but if it can work at tui (and at linux) also, then maybe was a fully workaround.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Guys, you are right, horizontal scrolling works fine in the gvim but doesn't in vim.
So, we can make it work without the gui, with some refactoring of the mouse and gui_ code
If you feel you are able to fix it then I totally agree, I'm personally using horizontal scrolling all time, somebody maybe doesn't, but I'm using it.
If I do that, it will impact more than just MS Windows
That is a good thing, isn't it? 😁 I can help you test it, if you decide to issue PR.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.![]()
@silverqx To clarify, I dont mean just in gVim. it works also in vim as well, as long as vim was compiled with the correct flags, its a fortunate side-effect of sharing some code between vim and gvim, when they are both compiled together, it just starts to work.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
I understand, thx
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
This was all about Where XXX is Up | Down | Left | Right
I dont think it is related to
I dont know what that is, tbh, perhaps useful for hover popups?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
well, i never use gvim, so as the doc told me that detected mouse move event and got mouse position.
// i meant to me tui vim can do something upon that, though just a workaround still.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
OK, I created separate branch for this mouse stuff. havent committed the changes yet, but want somehere to work with this.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()