wfxr / minimap.vim

📡 Blazing fast minimap / scrollbar for vim, powered by code-minimap written in Rust.
MIT License
1.19k stars 23 forks source link

Unexpected click+drag behavior within the minimap buffer #144

Closed invokah closed 2 years ago

invokah commented 2 years ago

Installation: manually, using #2 install script (after I used chmod +x minimap_generator.sh)

vim --version ``` VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 06 2022 17:44:00) Included patches: 1-3995 Modified by team+vim@tracker.debian.org Compiled by team+vim@tracker.debian.org Huge version without GUI. Features included (+) or not (-): +acl +cmdline_hist +ex_extra +jumplist +mouse_dec -perl +sodium +textobjects +wildmenu +arabic +cmdline_info +extra_search +keymap +mouse_gpm +persistent_undo -sound +textprop +windows +autocmd +comments -farsi +lambda -mouse_jsbterm +popupwin +spell +timers +writebackup +autochdir +conceal +file_in_path +langmap +mouse_netterm +postscript +startuptime +title -X11 -autoservername +cryptv +find_in_path +libcall +mouse_sgr +printer +statusline -toolbar -xfontset -balloon_eval +cscope +float +linebreak -mouse_sysmouse +profile -sun_workshop +user_commands -xim +balloon_eval_term +cursorbind +folding +lispindent +mouse_urxvt -python +syntax +vartabs -xpm -browse +cursorshape -footer +listcmds +mouse_xterm -python3 +tag_binary +vertsplit -xsmp ++builtin_terms +dialog_con +fork() +localmap +multi_byte +quickfix -tag_old_static +vim9script -xterm_clipboard +byte_offset +diff +gettext -lua +multi_lang +reltime -tag_any_white +viminfo -xterm_save +channel +digraphs -hangul_input +menu -mzscheme +rightleft -tcl +virtualedit +cindent -dnd +iconv +mksession +netbeans_intg -ruby +termguicolors +visual -clientserver -ebcdic +insert_expand +modify_fname +num64 +scrollbind +terminal +visualextra -clipboard +emacs_tags +ipv6 +mouse +packages +signs +terminfo +vreplace +cmdline_compl +eval +job -mouseshape +path_extra +smartindent +termresponse +wildignore system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-ecUvJz/vim-8.2.3995=. -fstack-protector-strong -Wformat -Werror=format-security -D_ REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -ldl ```
.vimrc ``` "vim configuration set nocompatible set ttyfast set ttymouse=sgr "extension settings let g:ranger_replace_netrw=1 let g:minimap_width=15 let g:minimap_auto_start=1 let g:minimap_auto_start_win_enter=1 let g:minimap_highlight_search=1 let g:minimap_highlight_range=1 let g:minimap_git_colors=1 "indent set autoindent set expandtab "set filetype indent on set shiftround set shiftwidth=4 set smarttab set tabstop=4 "search options "set hlsearch set ignorecase set incsearch set smartcase "performance options "set complete-=i "set lazyredraw "text rendering options set display+=lastline set encoding=utf-8 set linebreak set scrolloff=5 syntax enable set wrap set fillchars=vert:\│ "UI Options set cmdheight=2 set updatetime=300 set laststatus=2 set ruler set wildmenu "set tabpagemax=50 colorscheme gruvbox set cursorline set number set relativenumber set noerrorbells set visualbell set mouse=a set title set background=dark "Misc set autoread set backspace=indent,eol,start set backupdir=~/.cache/vim set confirm set dir=~/.cache/vim "set formatoptions+=j set hidden set history=1000 set nomodeline set noswapfile set smartindent set colorcolumn=95 "Window stuff set splitright set splitbelow " Don't pass messages to |ins-completion-menu|. set shortmess+=c " Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved. if has("patch-8.1.1564") " Recently vim can merge signcolumn and number column into one set signcolumn=number else set signcolumn=yes endif " Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Use to trigger completion. if has('nvim') inoremap coc#refresh() else inoremap coc#refresh() endif source /usr/share/doc/fzf/examples/fzf.vim ```

Action performed: I click on the minimap buffer, going to the correct line on initial click. Then, while holding my mouse button down still, I drag in any direction.

What happens: when clicking on the minimap buffer, if I drag in any direction, the minimap will move upwards (and my cursor, as well).

Behavior I expected: clicking the minimap, and then dragging upwards would send the cursor upwards, clicking the minimap, and then dragging it downwards would send the cursor downwards, and likewise for left/right (or left/right not moving the cursor at all).

Is this possibly a problem with how I have my vim configured? If I am careful, I can drag the cursor down one line before it begins travelling upwards.

ZNielsen commented 2 years ago

General mouse interaction varies a lot between different terminal emulators and gets even more messy when adding tmux or screen into the mix. The behavior I see is different than what you are describing (using iTerm2 + tmux on MacOS), so my guess is this is terminal emulator + mouse settings specific.

invokah commented 2 years ago

@ZNielsen I tried using 6 other terminal emulators and they all featured the same behavior. Do you have any other troubleshooting suggestions? I'm not entirely sure what could be changing/specifying my mouse behavior (I am using a barebones wm, i3). I'm sorry if this is wasting your time; I really do like minimap.vim and would like to keep using it (preferably with the click+drag working if I can get it to).

ZNielsen commented 2 years ago

It might be a platform thing? MacOS seems to handle moving with the mouse just fine. Last thing you might want to try is to use tmux as another buffer between your input and the terminal?

Video shows 1) Dragging with the mouse 2) Scroll wheel usage 3) Clicking to arbitrary lines 4) Dragging with the mouse again

https://user-images.githubusercontent.com/13890741/157894022-b73d1f91-6850-4dae-b02a-5e7b3f6f4dab.mp4

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.