macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.47k stars 680 forks source link

When using the GUI (`Vim -g`), `gx` doesn't open links #1477

Closed tjlevel12 closed 3 months ago

tjlevel12 commented 5 months ago

Steps to reproduce

  1. Create a file with links: echo "https://www.google.com" > /tmp/links.txt
  2. Open the file: /Applications/MacVim.app/Contents/MacOS/Vim -g /tmp/links.txt
  3. Ensure the cursor is over the link
  4. gx

Expected behaviour

I expect the link to open in my browser.

Instead, there's usually a brief flash and nothing else happens. It does seem to sometimes work (1 in every 20 or so). Selecting the text first doesn't seem to affect the behavior.

gx works as expected in the terminal (ie, /Applications/MacVim.app/Contents/MacOS/Vim /tmp/links.txt)

Version of Vim and architecture

:version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 12 2023 09:31:27)
macOS version - arm64
Included patches: 1-1897
Compiled by GitHub Actions
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl                +cryptv             +fork()             +mksession          +path_extra         +startuptime        +vartabs
+arabic             +cscope             +fullscreen         +modify_fname       +perl/dyn           +statusline         +vertsplit
+autocmd            +cursorbind         +gettext            +mouse              +persistent_undo    -sun_workshop       +vim9script
+autochdir          +cursorshape        -hangul_input       +mouseshape         +popupwin           +syntax             +viminfo
-autoservername     +dialog_con_gui     +iconv              +mouse_dec          +postscript         +tag_binary         +virtualedit
+balloon_eval       +diff               +insert_expand      -mouse_gpm          +printer            -tag_old_static     +visual
+balloon_eval_term  +digraphs           +ipv6               -mouse_jsbterm      +profile            -tag_any_white      +visualextra
+browse             +dnd                +job                +mouse_netterm      +python/dyn         -tcl                +vreplace
++builtin_terms     -ebcdic             +jumplist           +mouse_sgr          +python3/dyn-stable +termguicolors      +wildignore
+byte_offset        +emacs_tags         +keymap             -mouse_sysmouse     +quickfix           +terminal           +wildmenu
+channel            +eval               +lambda             +mouse_urxvt        +reltime            +terminfo           +windows
+cindent            +ex_extra           +langmap            +mouse_xterm        +rightleft          +termresponse       +writebackup
+clientserver       +extra_search       +libcall            +multi_byte         +ruby/dyn           +textobjects        -X11
+clipboard          -farsi              +linebreak          +multi_lang         +scrollbind         +textprop           -xfontset
+cmdline_compl      +file_in_path       +lispindent         -mzscheme           +signs              +timers             +xim
+cmdline_hist       +find_in_path       +listcmds           +netbeans_intg      +smartindent        +title              -xpm
+cmdline_info       +float              +localmap           +num64              +sodium             +toolbar            -xsmp
+comments           +folding            +lua/dyn            +odbeditor          +sound              +transparency       -xterm_clipboard
+conceal            -footer             +menu               +packages           +spell              +user_commands      -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/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: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -arch x86_64 -arch a
rm64 -I/usr/local/Cellar/libsodium/1.0.18_1/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshadow -Werror -Wno-deprecated-decla
rations -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations -Wno-error=unused-function
Linking:
clang -arch x86_64 -arch arm64 -L/usr/local/lib -o Vim -lm -lncurses /usr/local/lib/libsodium.a -liconv /usr/local/lib/libintl.a -framework AppKit

Environment

OS: macOS Term: iTerm2 ${TERM}: xterm-256color Shell: zsh Browser: chrome

vim is also installed from homebrew. I'm specifically interested in MacVim for the gvim capabilities.

How MacVim was installed

Downloaded from GitHub

Logs and stack traces

No response

Vim configuration where issue is reproducable

set guifont=Menlo-Regular:h14
set background=light

Issue has been tested with given configuration

Issue has been tested with no configuration

Other conditions

eirnym commented 5 months ago

I have MacVim r179 (Vim 9.1.0) installed via GitHub releases. My browser is Firefox.

I checked the steps provided and in my case web site opened immediately. I've checked both MacVim in terminal and GUI.

ychin commented 5 months ago

Thanks for checking, @eirnym. @tjlevel12 can you update to the latest MacVim first? The gx functionality is provided by the netrw plugin and had been seeing some flux over last few versions.

github-actions[bot] commented 3 months ago

This issue is stale because it has been waiting for a response for 45 days with no activity.