comparison src/tag.c @ 30106:0e9b58353412 v9.0.0389

patch 9.0.0389: crash when 'tagfunc' closes the window Commit: https://github.com/vim/vim/commit/ccfde4d028e891a41e3548323c3d47b06fb0b83e Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 5 19:51:13 2022 +0100 patch 9.0.0389: crash when 'tagfunc' closes the window Problem: Crash when 'tagfunc' closes the window. Solution: Bail out when the window was closed.
author Bram Moolenaar <Bram@vim.org>
date Mon, 05 Sep 2022 21:00:03 +0200
parents f4a7831fa352
children 360f286b5869
comparison
equal deleted inserted replaced
30105:d4352c59cedb 30106:0e9b58353412
687 if (find_tags(name, &new_num_matches, &new_matches, flags, 687 if (find_tags(name, &new_num_matches, &new_matches, flags,
688 max_num_matches, buf_ffname) == OK 688 max_num_matches, buf_ffname) == OK
689 && new_num_matches < max_num_matches) 689 && new_num_matches < max_num_matches)
690 max_num_matches = MAXCOL; // If less than max_num_matches 690 max_num_matches = MAXCOL; // If less than max_num_matches
691 // found: all matches found. 691 // found: all matches found.
692
693 // A tag function may do anything, which may cause various
694 // information to become invalid. At least check for the tagstack
695 // to still be the same.
696 if (tagstack != curwin->w_tagstack)
697 {
698 emsg(_(e_window_unexpectedly_close_while_searching_for_tags));
699 FreeWild(new_num_matches, new_matches);
700 break;
701 }
692 702
693 // If there already were some matches for the same name, move them 703 // If there already were some matches for the same name, move them
694 // to the start. Avoids that the order changes when using 704 // to the start. Avoids that the order changes when using
695 // ":tnext" and jumping to another file. 705 // ":tnext" and jumping to another file.
696 if (!new_tag && !other_name) 706 if (!new_tag && !other_name)