diff --git a/README.asciidoc b/README.asciidoc index 458f9123..7e421d14 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -1411,9 +1411,9 @@ existing hooks are: is '=' * `BufSetOption`: An option was set in a buffer context, the filtering text is '=' - * `BufNew`: A buffer for a new file has been created, filename is used for - filtering - * `BufOpen`: A buffer for an existing file has been created, filename is + * `BufNewFile`: A buffer for a new file has been created, filename is used + for filtering + * `BufOpenFile`: A buffer for an existing file has been created, filename is used for filtering * `BufCreate`: A buffer has been created, filename is used for filtering * `BufWritePre`: Executed just before a buffer is written, filename is diff --git a/doc/manpages/hooks.asciidoc b/doc/manpages/hooks.asciidoc index 65549692..27639257 100644 --- a/doc/manpages/hooks.asciidoc +++ b/doc/manpages/hooks.asciidoc @@ -92,11 +92,11 @@ Default hooks an option was set in a buffer context, the filtering text is *=* -*BufNew*:: +*BufNewFile*:: a buffer for a new file has been created, filename is used for filtering -*BufOpen*:: +*BufOpenFile*:: a buffer for an existing file has been created, filename is used for filtering diff --git a/rc/base/file.kak b/rc/base/file.kak index 0b7f60d2..934b0659 100644 --- a/rc/base/file.kak +++ b/rc/base/file.kak @@ -1,4 +1,4 @@ -hook global BufOpen .* %{ %sh{ +hook global BufOpenFile .* %{ %sh{ if [ -z "${kak_opt_filetype}" ]; then mime=$(file -b --mime-type "${kak_buffile}") case "${mime}" in diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index 228d127e..26d3222c 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -281,7 +281,7 @@ def -hidden c-family-insert-include-guards %{ } } -hook global BufNew .*\.(h|hh|hpp|hxx|H) c-family-insert-include-guards +hook global BufNewFile .*\.(h|hh|hpp|hxx|H) c-family-insert-include-guards decl str-list alt_dirs ".;.." diff --git a/rc/extra/autorestore.kak b/rc/extra/autorestore.kak index 400c4e96..ea26edd7 100644 --- a/rc/extra/autorestore.kak +++ b/rc/extra/autorestore.kak @@ -60,4 +60,4 @@ def autorestore-disable -docstring "Disable automatic backup recovering" %{ remove-hooks global autorestore } -hook -group autorestore global BufOpen .* %{ autorestore-restore-buffer } +hook -group autorestore global BufOpenFile .* %{ autorestore-restore-buffer } diff --git a/rc/extra/modeline.kak b/rc/extra/modeline.kak index d48661b7..b887b24f 100644 --- a/rc/extra/modeline.kak +++ b/rc/extra/modeline.kak @@ -97,7 +97,7 @@ def -hidden modeline-parse-impl %{ } } -# Add the following function to a hook on BufOpen to automatically parse modelines +# Add the following function to a hook on BufOpenFile to automatically parse modelines # Select the first and last `modelines` lines in the buffer, only keep modelines def modeline-parse -docstring "Read and interpret vi-format modelines at the beginning/end of the buffer" %{ try %{ eval -draft %{ diff --git a/src/buffer.cc b/src/buffer.cc index e02720ca..09535366 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -107,11 +107,11 @@ void Buffer::on_registered() if (m_flags & Flags::File) { if (m_flags & Buffer::Flags::New) - run_hook_in_own_context("BufNew", m_name); + run_hook_in_own_context("BufNewFile", m_name); else { kak_assert(m_fs_timestamp != InvalidTime); - run_hook_in_own_context("BufOpen", m_name); + run_hook_in_own_context("BufOpenFile", m_name); } }