JaySandhu

JaySandhu

Member Since 7 years ago

Experience Points
5
follower
Lessons Completed
0
follow
Lessons Completed
4
stars
Best Reply Awards
3
repos

181 contributions in the last year

Pinned
⚡ A fast Neovim GUI for macOS.
⚡ Xcode.vim - A Vim port of the default Xcode colorscheme
⚡ Vim-fork focused on extensibility and usability
Activity
Mar
2
2 months ago
Activity icon
issue

JaySandhu issue comment neovim/neovim

JaySandhu
JaySandhu

Add mousescroll option

Building on https://github.com/neovim/neovim/pull/1288 by @cepko33 and on https://github.com/neovim/neovim/pull/10954 by @qstrahl. Close #11738

Adds a mousescroll option which I understand now has the green light.

Motivation Scrolling with a trackpad feels off with the current hardcoded value. Remapping the scroll wheel keys to <C-Y> and <C-E>, as is commonly suggested, is not a great alternative, you can no longer scroll inactive windows.

The new option defaults to 1, which is different from the old hardcoded value of 3, but I think is a more reasonable default. This can be changed if needed.

Horizontal scrolling still uses a hardcoded value (6 I believe).

  • Add the option
  • Document the option
  • Test the option manually
  • Create a new automated test
  • Update :help scroll-mouse-wheel
  • Update :help vim-differences
JaySandhu
JaySandhu

Rebased and addressed the main CI issue. The type of error messages was changed from char_u* to char* in https://github.com/neovim/neovim/commit/efa924f66b183d9cf2404ce91c4f009c27e0515a. This PR was still using char_u* so the compiler was complaining type mismatches.

I believe the remaining CI failures are unrelated (could be wrong though).

push

JaySandhu push JaySandhu/neovim

JaySandhu
JaySandhu

feat: add 'mousescroll' option

Add 'mousescroll' option to control how many lines to scroll by when a mouse wheel keycode is received. The mousescroll option controls both horizontal and vertical scrolling. The option is a string in the format:

set mousescroll=direction:count,direction:count

Where direction is either 'ver' or 'hor', and count is a non negative integer. If a direction is omitted, a default value is used. The default values remain unchanged, that is 3 for vertical scrolling, and 6 for horizontal scrolling. As such, the mousescroll default is "ver:3,hor:6".

Add mousescroll documentation

  • Add option documentation in options.txt
  • Add brief summary in quickref.txt

Update :help scroll-mouse-wheel

  • Mention mousescroll option as a means of controlling scrolling.
  • Remove obsolete suggestion to map scroll wheel keys to to scroll by a single line -- users should prefer the mousescroll option.
  • Add some information about the consequences of remapping scroll wheel keys (they lose their magic ability to affect inactive windows).

Update :help vim-differences

  • Add brief mousescroll summary under Options

Add mousescroll tests

  • Test option validation
  • Test default mousescroll value and behavior
  • Test fallback to default values
  • Test mouse vertical and horizontal scrolling in normal mode
  • Test mouse vertical and horizontal scrolling in insert mode

commit sha: 2d528971881996ffe8f66fa51c0c7e11a4dac10a

push time in 2 months ago
push

JaySandhu push JaySandhu/neovim

JaySandhu
JaySandhu

vim-patch:8.1.1798: warning for unused variable in tiny version

Problem: Warning for unused variable in tiny version. (Tony Mechelynck) Solution: Move inside #35f7127c6ac51573eda808687f6369c31ee2d

JaySandhu
JaySandhu

refactor: fix indent in decode.c (#16543)

JaySandhu
JaySandhu

vim-patch:8.1.2104: the normal.c file is too big (#16389)

Problem: The normal.c file is too big. Solution: Move do_pending_operator() to ops.c. (Yegappan Lakshmanan, closes vim/vim#4999). https://github.com/vim/vim/commit/792cf5e1bec04c6d6d70cfbb9ef24c798b469731

JaySandhu
JaySandhu

Merge pull request #16107 from zeertzjq/vim-8.1.1542

vim-patch:8.1.1542,8.2.3549: an OptionSet autocommand does not get enough info

JaySandhu
JaySandhu

Merge pull request #16546 from zeertzjq/vim-8.1.1797

vim-patch:8.1.{1797,1798}: the vgetorpeek() function is too long

JaySandhu
JaySandhu

Merge pull request #16194 from seandewar/vim-8.1.1925

vim-patch:7.4.1777,8.1.{1925,1995,2011,2012,2013,2166},8.2.{0532,0871,1168,1241,3576}

JaySandhu
JaySandhu

fix: don't include pty.h on SunOS

JaySandhu
JaySandhu

fix: don't use cfsetspeed, use i and o variants

cfsetspeed is not available on SunOS, use cfsetispeed and cfsetospeed instead.

JaySandhu
JaySandhu

vim-patch:8.1.0035: not easy to switch between prompt buffer and other windows

Problem: Not easy to switch between prompt buffer and other windows. Solution: Accept CTRL-W commands in Insert mode. Start and stop Insert mode as one would expect. https://github.com/vim/vim/commit/6d41c78e353b630bc1a72cbff9160311d2a81e8c

Cherry-pick channel.txt change from: https://github.com/vim/vim/commit/d2f3a8b8787333abf2300d38836b196955f10c00

b_prompt_insert was already ported.

JaySandhu
JaySandhu

fix(prompt): add missing changes from v8.1.0036

v8.1.0036 is already marked as ported, but missed out changes that depended on v8.1.0035.

JaySandhu
JaySandhu

vim-patch:8.1.0042: if omni completion opens a window Insert mode is stopped

Problem: If omni completion opens a window Insert mode is stopped. (Hirohito Higashi) Solution: Only set stop_insert_mode in a prompt buffer window. https://github.com/vim/vim/commit/f98b845dd185dfadfa7a622a42452bfa6809d4e0

popupmenu_spec.lua fails without this.

JaySandhu
JaySandhu

vim-patch:8.1.0064: typing CTRL-W in a prompt buffer shows mode "-- --"

Problem: Typing CTRL-W in a prompt buffer shows mode "-- --". Solution: Set restart_edit to 'A' and check for it. https://github.com/vim/vim/commit/942b4541a2d8e8df8369ab70e112dbbbe0c7c0aa

Nvim already checked for 'i' in showmode(), so this bug was fixed with (though this patch now changes to use 'A').

However, the missing changes I ported for v8.1.0036 use 'A' when a callback leaves the window in insert mode and edit gets restarted, so this bug was possible there.

Modify showmode() restart_edit condition to match v8.2.1978: https://github.com/vim/vim/commit/957cf67d50516ba98716f59c9e1cb6412ec1535d

JaySandhu
JaySandhu

vim-patch:8.2.1781: writing to prompt buffer interferes with insert mode

Problem: Writing to prompt buffer interferes with insert mode. Solution: Use win_enter() instead of just setting "curwin". (Ben Jackson, closes vim/vim#7035) https://github.com/vim/vim/commit/4537bcc88956f86267c25edf8008e0dbde598652

Vim test will be skipped, so add a Lua test. The problem boils down to the use of aucmd_restbuf in a callback, so just test that (via nvim_buf_set_lines).

JaySandhu
JaySandhu

vim-patch:8.2.1783: try-catch test fails

Problem: Try-catch test fails. Solution: Don't call win_enter(), only call enterering_window(). https://github.com/vim/vim/commit/bdf931c25b4fe78877106ca529baee7899d0f6a4

v8.2.1781 caused Test_reload_in_try_catch() from v8.2.0004 to fail in Vim, but it has not been ported yet.

JaySandhu
JaySandhu

vim-patch:8.2.1976: cannot backspace in prompt buffer after using cursor-left

Problem: Cannot backspace in prompt buffer after using cursor-left. (Maxim Kim) Solution: Ignore "arrow_used" in a prompt buffer. (closes vim/vim#7281) https://github.com/vim/vim/commit/6f6244855fbce5aaa718cd5001a29aac3c5c15d6

cmdchar_todo wasn't adapted properly for Nvim's state system, which caused it to be a dead store and such was removed in #11900.

Re-introduce cmdchar_todo properly.

JaySandhu
JaySandhu

vim-patch:8.2.2014: using CTRL-O in a prompt buffer moves cursor to start

Problem: Using CTRL-O in a prompt buffer moves cursor to start of the line. Solution: Do not move the cursor when restarting edit. (closes vim/vim#7330) https://github.com/vim/vim/commit/ee8b787bcd15f63a938243770065e704c9b5c85f

Test_prompt_editing is skipped, so edit the Lua test in prompt_buffer_spec.

JaySandhu
JaySandhu

test(prompt_buffer_spec): include changes from v8.1.1984

I already ported v8.1.1984 previously, but hadn't updated prompt_buffer_spec to match test_prompt_buffer (which we have but due to Vim features such as term_sendkeys it's mostly skipped).

Required for v8.2.3671.

JaySandhu
JaySandhu

vim-patch:8.2.3671: restarting Insert mode in prompt buffer too often

Problem: Restarting Insert mode in prompt buffer too often when a callback switches windows and comes back. (Sean Dewar) Solution: Do not set "restart_edit" when already in Insert mode. https://github.com/vim/vim/commit/34c20ff85b87be587ea5d0398812441b502ee6a5

As Test_prompt_switch_windows is skipped, implement it in prompt_buffer_spec.

Replace the 50ms term_wait calls with poke_eventloop (test seems to work anyway without them, so maybe they're not required?)

The new test does include a duplicate screen test that may generate a "screen test succeeded immediately" warning, but this is done to match the Vim test.

JaySandhu
JaySandhu

fix(highlight): always update window highlight if highlight changed

JaySandhu
JaySandhu

fix(screen): do not draw filler lines post eof if already at last row

commit sha: e3b189e5cc7e41f0a700458d876d0839d2fbf4e4

push time in 2 months ago
Mar
1
2 months ago
open pull request

JaySandhu wants to merge neovim/neovim

JaySandhu
JaySandhu

Add mousescroll option

Building on https://github.com/neovim/neovim/pull/1288 by @cepko33 and on https://github.com/neovim/neovim/pull/10954 by @qstrahl.

Adds a mousescroll option which I understand now has the green light.

Motivation Scrolling with a trackpad feels off with the current hardcoded value. Remapping the scroll wheel keys to <C-Y> and <C-E>, as is commonly suggested, is not a great alternative, you can no longer scroll inactive windows.

The new option defaults to 1, which is different from the old hardcoded value of 3, but I think is a more reasonable default. This can be changed if needed.

Horizontal scrolling still uses a hardcoded value (6 I believe).

  • Add the option
  • Document the option
  • Test the option manually
  • Create a new automated test
  • Update :help scroll-mouse-wheel
  • Update :help vim-differences
JaySandhu
JaySandhu

Made the change. Squashed the commit for cleaner repo history. Thanks for reviewing these old PRs btw 🙂.

pull request

JaySandhu merge to neovim/neovim

JaySandhu
JaySandhu

Add mousescroll option

Building on https://github.com/neovim/neovim/pull/1288 by @cepko33 and on https://github.com/neovim/neovim/pull/10954 by @qstrahl.

Adds a mousescroll option which I understand now has the green light.

Motivation Scrolling with a trackpad feels off with the current hardcoded value. Remapping the scroll wheel keys to <C-Y> and <C-E>, as is commonly suggested, is not a great alternative, you can no longer scroll inactive windows.

The new option defaults to 1, which is different from the old hardcoded value of 3, but I think is a more reasonable default. This can be changed if needed.

Horizontal scrolling still uses a hardcoded value (6 I believe).

  • Add the option
  • Document the option
  • Test the option manually
  • Create a new automated test
  • Update :help scroll-mouse-wheel
  • Update :help vim-differences
push

JaySandhu push JaySandhu/neovim

JaySandhu
JaySandhu

feat: add 'mousescroll' option

Add 'mousescroll' option to control how many lines to scroll by when a mouse wheel keycode is received. The mousescroll option controls both horizontal and vertical scrolling. The option is a string in the format:

set mousescroll=direction:count,direction:count

Where direction is either 'ver' or 'hor', and count is a non negative integer. If a direction is omitted, a default value is used. The default values remain unchanged, that is 3 for vertical scrolling, and 6 for horizontal scrolling. As such, the mousescroll default is "ver:3,hor:6".

Add mousescroll documentation

  • Add option documentation in options.txt
  • Add brief summary in quickref.txt

Update :help scroll-mouse-wheel

  • Mention mousescroll option as a means of controlling scrolling.
  • Remove obsolete suggestion to map scroll wheel keys to to scroll by a single line -- users should prefer the mousescroll option.
  • Add some information about the consequences of remapping scroll wheel keys (they lose their magic ability to affect inactive windows).

Update :help vim-differences

  • Add brief mousescroll summary under Options

Add mousescroll tests

  • Test option validation
  • Test default mousescroll value and behavior
  • Test fallback to default values
  • Test mouse vertical and horizontal scrolling in normal mode
  • Test mouse vertical and horizontal scrolling in insert mode

commit sha: dcae03bfb8756b5152b251e2b7822ff5a8103fd6

push time in 2 months ago