comparison src/terminal.c @ 19713:8514e8b7e661 v8.2.0413

patch 8.2.0413: buffer menu does not handle special buffers properly Commit: https://github.com/vim/vim/commit/5e94a29ebbde10dd973d58f1adba9a2fc83877d1 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 19 18:46:57 2020 +0100 patch 8.2.0413: buffer menu does not handle special buffers properly Problem: Buffer menu does not handle special buffers properly. Solution: Keep a dictionary with buffer names to reliably keep track of entries. Also trigger BufFilePre and BufFilePost for command-line and terminal buffers when the name changes.
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Mar 2020 19:00:04 +0100
parents dd3e5533a7d2
children eb4887dd4b60
comparison
equal deleted inserted replaced
19712:714875349336 19713:8514e8b7e661
521 521
522 // Link the new terminal in the list of active terminals. 522 // Link the new terminal in the list of active terminals.
523 term->tl_next = first_term; 523 term->tl_next = first_term;
524 first_term = term; 524 first_term = term;
525 525
526 apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
527
526 if (opt->jo_term_name != NULL) 528 if (opt->jo_term_name != NULL)
527 curbuf->b_ffname = vim_strsave(opt->jo_term_name); 529 curbuf->b_ffname = vim_strsave(opt->jo_term_name);
528 else if (argv != NULL) 530 else if (argv != NULL)
529 curbuf->b_ffname = vim_strsave((char_u *)"!system"); 531 curbuf->b_ffname = vim_strsave((char_u *)"!system");
530 else 532 else
568 } 570 }
569 } 571 }
570 vim_free(curbuf->b_sfname); 572 vim_free(curbuf->b_sfname);
571 curbuf->b_sfname = vim_strsave(curbuf->b_ffname); 573 curbuf->b_sfname = vim_strsave(curbuf->b_ffname);
572 curbuf->b_fname = curbuf->b_ffname; 574 curbuf->b_fname = curbuf->b_ffname;
575
576 apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
573 577
574 if (opt->jo_term_opencmd != NULL) 578 if (opt->jo_term_opencmd != NULL)
575 term->tl_opencmd = vim_strsave(opt->jo_term_opencmd); 579 term->tl_opencmd = vim_strsave(opt->jo_term_opencmd);
576 580
577 if (opt->jo_eof_chars != NULL) 581 if (opt->jo_eof_chars != NULL)