macvim icon indicating copy to clipboard operation
macvim copied to clipboard

Freeze when exiting a taglist window

Open adah1972 opened this issue 8 years ago • 19 comments

I am using the taglist plugin. I've found a strange issue: when I open a taglist window—with :TlistOpen—and then try closing the whole MacVim window without closing the taglist window separately with :TlistClose, MacVim freezes.

More investigation shows that this apparently innocent line in taglist.vim caused the freeze (commenting it out eliminates the problem):

let &columns= &columns - (g:Tlist_WinWidth + 1)

It looks like bug in MacVim. There is no such problem in, say, gVim for Windows.

I am currently using macvim stable 8.0-134 (bottled) from Homebrew.

adah1972 avatar Jul 25 '17 07:07 adah1972

@adah1972 Does it still an issue?

eirnym avatar Jun 17 '19 20:06 eirnym

I can still reproduce this issue with the latest Homebrew build, version 8.1.1517 (156).

adah1972 avatar Jun 19 '19 05:06 adah1972

Is it be reproducible with (Mac)Vim from terminal?

eirnym avatar Jun 19 '19 06:06 eirnym

No, not in a terminal.

One more important thing: I have just discovered that it happens in the GUI only when I check "Use Core Text Renderer". After unchecking it, the problem goes away.

adah1972 avatar Jun 19 '19 07:06 adah1972

Thank you, it's a very valuable addition to investigate further.

eirnym avatar Jun 19 '19 07:06 eirnym

BTW, it's a quite strange, as I use NERDTree without a problem. Probably it's caused by using outdated features, as this plugin wasn't updated since ... 2013 and Vim changed quite a bit.

I'll investigate how to install it on plugin managers era and will play around

eirnym avatar Jun 19 '19 07:06 eirnym

Meanwhile you can play around with tagbar as it seems to be newer with about the same functionality

eirnym avatar Jun 19 '19 07:06 eirnym

Still, it is a strange thing that changing &columns about the time of an exit will cause a freeze. Even though taglist is old, what it does seems innocent to me…

Thanks for recommending tagbar. I'll take a look.

adah1972 avatar Jun 19 '19 07:06 adah1972

I've just tried tagbar. It looks impressive, but it does not change the window width (as taglist does). So there is no way it can trigger a bug like this.

(If I turn off the window width change with let Tlist_Inc_Winwidth=0, taglist will not trigger this bug either.)

adah1972 avatar Jun 19 '19 07:06 adah1972

Wow! Thank you for an additional discovery to narrow down the reason where bug is triggered!

eirnym avatar Jun 19 '19 18:06 eirnym

If there is a way to freeze MacVim this definitely needs to be fixed. Tagging to the next milestone.

ychin avatar Jun 21 '19 07:06 ychin

Documentation in code says about this variable below.

    " Increase Vim window width to display vertically split taglist window.
    " For MS-Windows version of Vim running in a MS-DOS window, this must be
    " set to 0 otherwise the system may hang due to a Vim limitation.
    if !exists('Tlist_Inc_Winwidth')
        if (has('win16') || has('win95')) && !has('gui_running')
            let Tlist_Inc_Winwidth = 0
        else
            let Tlist_Inc_Winwidth = 1
        endif
    endif

@ychin This actually do the following: let &columns= &columns - (g:Tlist_WinWidth + 1)

eirnym avatar Jun 21 '19 18:06 eirnym

I can't make it freeze with taglist 4.6 and MacVim 156.

eirnym avatar Jun 21 '19 18:06 eirnym

@eirnym Did you turn on "Use Core Text Renderer"? It is triggered only when the Core Text Renderer is used.

adah1972 avatar Jun 24 '19 08:06 adah1972

yes, I have only "quick start" turned off (see my defaults below) . I've executed the line with various values manually and tried this plugin as well. I use a binary build from GitHub, not from Homebrew.

PS: I've attached this plugin by putting it into new local git repo and used Vim-Plug to import it. I don't remember how to put such plugins in "old way". It'll be helpful to investigate further if you share your configuration which produces the freeze. A copy of my .vim folder is public (you need to start vim 2 times to attach all plugins)

$ defaults read org.vim.MacVim
{
    MMAutosaveColumns = 84;
    MMAutosaveRows = 52;
    MMCurrentPreferencePane = General;
    MMLastWindowClosedBehavior = 1;
    MMOpenLayout = 4;
    MMRenderer = 1;
    MMTopLeftPoint = "{270, 807}";
    NSNavLastRootDirectory = "~";
    NSNavLastUserSetHideExtensionButtonState = 0;
    NSNavPanelExpandedSizeForOpenMode = "{799, 448}";
    NSNavPanelExpandedSizeForSaveMode = "{712, 448}";
    NSQuotedKeystrokeBinding = "";
    NSRepeatCountBinding = "";
    "NSWindow Frame NSFontPanel" = "929 110 445 237 0 0 1440 877 ";
    "NSWindow Frame SUUpdateAlert" = "650 510 620 392 0 0 1920 1057 ";
    SUCheckAtStartup = 1;
    SUEnableAutomaticChecks = 1;
    SUHasLaunchedBefore = 1;
    SULastCheckTime = "2019-06-24 15:02:42 +0000";
    SUSendProfileInfo = 0;
}

eirnym avatar Jun 24 '19 15:06 eirnym

The build (Homebrew) caused the difference? I do not see other significant differences. My OS is High Sierra, BTW.

I did this to test:

cd ~
mv .vimrc .vimrc_bak
mkdir .vim
cp -pr .vim_bak/pack/my/start/taglist/* .vim/

Lauching mvim after doing this, I can still reproduce the problem.

adah1972 avatar Jun 27 '19 09:06 adah1972

I still can't reproduce. I have to install Homebrew and try the version from it.

eirnym avatar Jun 27 '19 16:06 eirnym

My MacVim's feature list, in case it helps:

Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       +tcl
+arabic            +find_in_path      +mouse_xterm       +termguicolors
+autocmd           +float             +multi_byte        +terminal
+autochdir         +folding           +multi_lang        +terminfo
-autoservername    -footer            -mzscheme          +termresponse
+balloon_eval      +fork()            +netbeans_intg     +textobjects
+balloon_eval_term +fullscreen        +num64             +textprop
+browse            -gettext           +odbeditor         +timers
++builtin_terms    -hangul_input      +packages          +title
+byte_offset       +iconv             +path_extra        +toolbar
+channel           +insert_expand     +perl              +transparency
+cindent           +job               +persistent_undo   +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby              +wildmenu
+cursorbind        +lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con_gui    +mksession         +smartindent       -X11
+diff              +modify_fname      -sound             -xfontset
+digraphs          +mouse             +spell             +xim
+dnd               +mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        -xsmp
+emacs_tags        -mouse_gpm         -sun_workshop      -xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary
+extra_search      +mouse_sgr         -tag_old_static
-farsi             -mouse_sysmouse    -tag_any_white

adah1972 avatar Jun 28 '19 02:06 adah1972

Thank you

eirnym avatar Jun 29 '19 07:06 eirnym