Hi Nikolay!

On Fr, 21 Okt 2016, Nikolay Aleksandrovich Pavlov wrote:

> 2016-10-21 12:32 GMT+03:00 Christian Brabandt <[email protected]>:
> > Bram,
> > this patch adds the documentation suggestion from #1180 to the manual.
> > The basic work was done by Gary Johnson, I just improved it a little by
> > adding it to the TOC.
> 
> This is missing some descriptions regarding what “myfile” is.
> Specifically in the example
> 
> - myfile was already opened once (no BufNew or BufAdd)
> - and is either hidden or displayed in another buffer (no BufNewFile
> or BufRead* which would be seen if myfile buffer was unloaded after
> opening)

So we are missing BufNew, BufAdd and BufReadCmd. So how about this then.

Best,
Christian
-- 
Computer können nicht denken.
Nur Menschen denken, daß Computer denken.
                -- Michael Uhlemann

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
From 52f0a6c81391ff28fe8f3cadd9e3f9056449e50c Mon Sep 17 00:00:00 2001
From: Christian Brabandt <[email protected]>
Date: Fri, 21 Oct 2016 11:25:24 +0200
Subject: [PATCH] document sequence of autocommands

closes #1180

This is just an addition to the documentation on how sequences of
autocommands are executed. Currently only documented for :tabnew
If needed, we can add more sequences for other autocommands as well.

Done By Gary Johnson, I have just cleaned it up a bit and added links
from the TOC.
---
 runtime/doc/autocmd.txt | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index b901f21..f4cc65b 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -19,6 +19,7 @@ For a basic explanation, see section |40.3| in the user manual.
 9.  Executing autocommands	|autocmd-execute|
 10. Using autocommands		|autocmd-use|
 11. Disabling autocommands	|autocmd-disable|
+12. Sequences of autocommands	|autocmd-sequences|
 
 {Vi does not have any of these commands}
 {only when the |+autocmd| feature has not been disabled at compile time}
@@ -1482,5 +1483,30 @@ following command.  Example: >
 This will write the file without triggering the autocommands defined by the
 gzip plugin.
 
+==============================================================================
+12. Sequences of autocommand events			*autocmd-sequences* 
+
+Most Vim commands initiate a sequence of events, some of which cause
+autocommand events (|autocmd-events|) to be generated as they occur.  Which
+autocommand events are generated in response to Vim events and the sequence in
+which they occur can be confusing, yet understanding them can be critical to
+getting expected results from using them.  Here are some Vim events and the
+resulting sequence of autocommand events.
+
+The command is executed in the buffer oldfile: >
+
+    :tabnew myfile
+<
+  NR Event        Description ~
+  1. WinEnter     "%" is name of old buffer: "oldfile" ~
+  2. TabNew ~
+  3. TabEnter ~
+  4. BufNew       only when myfile was not opened yet (or unloaded) ~
+  5. BufAdd       only when myfile was not opened yet (or unloaded) ~
+                  until here, "%" is name of old buffer, "oldfile" ~
+  6. BufReadCmd   only if myfile not opened and event defined for myfile ~
+                  from here on "%" is name of the new buffer: "myfile" ~
+  7. BufEnter ~
+  8. BufWinEnter ~
 
  vim:tw=78:ts=8:ft=help:norl:
-- 
2.9.3

Raspunde prin e-mail lui