Mercurial > vim
comparison src/memline.c @ 10575:01a5f64a7a20 v8.0.0177
patch 8.0.0177: BufEnter autocommand not fired for a directory
commit https://github.com/vim/vim/commit/e13b9afe1283f5ae43232b5992372a0eb570666c
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 13 22:01:02 2017 +0100
patch 8.0.0177: BufEnter autocommand not fired for a directory
Problem: When opening a buffer on a directory and inside a try/catch then
the BufEnter event is not triggered.
Solution: Return NOTDONE from readfile() for a directory and deal with the
three possible return values. (Justin M. Keyes, closes #1375,
closes #1353)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 13 Jan 2017 22:15:03 +0100 |
parents | 66f1b5bf3fa6 |
children | 5780bd3a5a7e |
comparison
equal
deleted
inserted
replaced
10574:7eaa92b1da91 | 10575:01a5f64a7a20 |
---|---|
1517 if (!cannot_open) | 1517 if (!cannot_open) |
1518 { | 1518 { |
1519 line_count = pp->pb_pointer[idx].pe_line_count; | 1519 line_count = pp->pb_pointer[idx].pe_line_count; |
1520 if (readfile(curbuf->b_ffname, NULL, lnum, | 1520 if (readfile(curbuf->b_ffname, NULL, lnum, |
1521 pp->pb_pointer[idx].pe_old_lnum - 1, | 1521 pp->pb_pointer[idx].pe_old_lnum - 1, |
1522 line_count, NULL, 0) == FAIL) | 1522 line_count, NULL, 0) != OK) |
1523 cannot_open = TRUE; | 1523 cannot_open = TRUE; |
1524 else | 1524 else |
1525 lnum += line_count; | 1525 lnum += line_count; |
1526 } | 1526 } |
1527 if (cannot_open) | 1527 if (cannot_open) |