Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Restore cursor position when toggling in/out of breakpoints window #782

Closed
2 tasks done
Aster89 opened this issue Jul 21, 2023 · 1 comment
Closed
2 tasks done
Labels
Severity 3+ The issue is rare or cosmetic, or unfixable

Comments

@Aster89
Copy link
Contributor

Aster89 commented Jul 21, 2023

Description

See the title.

I'm not sure if the behavior has changed recently, or if I've always dismissed the breakpoint window from anywhere except the breakpoint window itself, though.

Works in vim?

Reproducable in Vim

Works with clean config?

Yes

Sample project works?

Reproducable with sample project

Minimal Reproduction

  1. vim --clean -Nu ~/.vim/plugged/vimspector/support/minimal_vimrc whatever
  2. :call vimspector#Launch()
  3. Whatever configuration
  4. Move the cursor to the code window
  5. :VimspectorBreakpoints twice

Expected Behaviour

Cursor to return to the last window the cursor was before moving to the breakpoint window.

Actual Behaviour

Cursor moves to the top left window

Additional information

No response

Installation Type

Plugin Manager (git clone)

Vimspector version

95791ba

Debug Info

No response

Log file

No response

Vim version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jul 08 2023 13:06:53)
Included patches: 1-1676
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +channel           +cscope            +ex_extra          -hangul_input      +linebreak         +mouse_dec         -mzscheme          +profile           -sodium            +tcl/dyn           +user_commands     +wildmenu
+arabic            +cindent           +cursorbind        +extra_search      +iconv             +lispindent        +mouse_gpm         +netbeans_intg     -python            +sound             +termguicolors     +vartabs           +windows
+autocmd           +clientserver      +cursorshape       -farsi             +insert_expand     +listcmds          -mouse_jsbterm     +num64             +python3/dyn       +spell             +terminal          +vertsplit         +writebackup
+autochdir         +clipboard         +dialog_con_gui    +file_in_path      +ipv6              +localmap          +mouse_netterm     +packages          +quickfix          +startuptime       +terminfo          +vim9script        +X11
-autoservername    +cmdline_compl     +diff              +find_in_path      +job               +lua/dyn           +mouse_sgr         +path_extra        +reltime           +statusline        +termresponse      +viminfo           -xfontset
+balloon_eval      +cmdline_hist      +digraphs          +float             +jumplist          +menu              -mouse_sysmouse    +perl/dyn          +rightleft         -sun_workshop      +textobjects       +virtualedit       +xim
+balloon_eval_term +cmdline_info      +dnd               +folding           +keymap            +mksession         +mouse_urxvt       +persistent_undo   +ruby/dyn          +syntax            +textprop          +visual            -xpm
+browse            +comments          -ebcdic            -footer            +lambda            +modify_fname      +mouse_xterm       +popupwin          +scrollbind        +tag_binary        +timers            +visualextra       +xsmp_interact
++builtin_terms    +conceal           +emacs_tags        +fork()            +langmap           +mouse             +multi_byte        +postscript        +signs             -tag_old_static    +title             +vreplace          +xterm_clipboard
+byte_offset       +cryptv            +eval              +gettext           +libcall           +mouseshape        +multi_lang        +printer           +smartindent       -tag_any_white     +toolbar           +wildignore        -xterm_save
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/lib
png16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-at
k/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build
/vim/src=/usr/src/debug/vim -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -L/usr/local/lib -o vim -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixb
uf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lcanberra -lacl -lattr -lgpm -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -fstack-pr
otector-strong -L/usr/local/lib -L/usr/lib/perl5/5.36/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

Python version

No response

Neovim diagnostics

No response

Operating System

No response

Declaration

@puremourning
Copy link
Owner

Unfortunately this is just how windows work in Vim.

You can reproduce the behaviour independently of Vimspector:

  • vim -Nu NONE
  • :vspl
  • :split
  • :split
  • <CTRL-W>l (cursor in window on right)
  • :botright 5new (cursor in bottom split)
  • :q (cursor is placed in first - top left - window)

https://asciinema.org/a/2k9PJXo3a9A9pclYQYTy88Rbe

I mean it would be pretty tricky to work around this in vimspector. I'm not sure of an obvious way other than fiddling with marks and hacking WinClosed and stuff. Either way it would be a lot of work and for relatively little benefit.

I certainly don't consider it a bug per se.

@puremourning puremourning changed the title :VimspectorBreakpoints from the breakpoint window leaves the cursor in the Variables window (top left) [Feature Request] Restore cursor position when toggling in/out of breakpoints window Aug 19, 2023
@puremourning puremourning added the Severity 3+ The issue is rare or cosmetic, or unfixable label Aug 19, 2023
@Aster89 Aster89 closed this as completed May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity 3+ The issue is rare or cosmetic, or unfixable
Projects
None yet
Development

No branches or pull requests

2 participants