aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-08 03:44:00 +0200
committerGitHub <noreply@github.com>2019-04-08 03:44:00 +0200
commit11bf89e3b58be1dd534b4ea49b1988150cf7d4b8 (patch)
treed13bc141aa3ea8b28c38da091d4cf6af1fcbc040 /src
parent943bedfc86abb2c6ac20079c1c3a4baac1bd726e (diff)
parentce76dffda46db99f073e4bcc159507024d2bfbe8 (diff)
downloadrneovim-11bf89e3b58be1dd534b4ea49b1988150cf7d4b8.tar.gz
rneovim-11bf89e3b58be1dd534b4ea49b1988150cf7d4b8.tar.bz2
rneovim-11bf89e3b58be1dd534b4ea49b1988150cf7d4b8.zip
Merge #9796 from justinmk/doc
Diffstat (limited to 'src')
-rw-r--r--src/nvim/auevents.lua3
-rw-r--r--src/nvim/log.c21
-rw-r--r--src/nvim/map.c12
3 files changed, 24 insertions, 12 deletions
diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua
index 32a7920b6e..ef528f72b8 100644
--- a/src/nvim/auevents.lua
+++ b/src/nvim/auevents.lua
@@ -65,7 +65,6 @@ return {
'InsertCharPre', -- before inserting a char
'InsertEnter', -- when entering Insert mode
'InsertLeave', -- when leaving Insert mode
- 'JobActivity', -- when job sent some data
'MenuPopup', -- just before popup menu is displayed
'OptionSet', -- after setting any option
'QuickFixCmdPost', -- after :make, :grep etc.
@@ -89,7 +88,7 @@ return {
'TabNew', -- when creating a new tab
'TabNewEntered', -- after entering a new tab
'TermChanged', -- after changing 'term'
- 'TermClose', -- after the processs exits
+ 'TermClose', -- after the process exits
'TermOpen', -- after opening a terminal buffer
'TermResponse', -- after setting "v:termresponse"
'TextChanged', -- text was modified
diff --git a/src/nvim/log.c b/src/nvim/log.c
index 8066b6e828..a2f83d4d09 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -1,6 +1,13 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
+//
+// Log module
+//
+// How Linux printk() handles recursion, buffering, etc:
+// https://lwn.net/Articles/780556/
+//
+
#include <assert.h>
#include <inttypes.h>
#include <stdarg.h>
@@ -99,9 +106,14 @@ void log_unlock(void)
uv_mutex_unlock(&mutex);
}
-/// @param context description of a shared context or subsystem
-/// @param func_name function name, or NULL
-/// @param line_num source line number, or -1
+/// Logs a message to $NVIM_LOG_FILE.
+///
+/// @param log_level Log level (see log.h)
+/// @param context Description of a shared context or subsystem
+/// @param func_name Function name, or NULL
+/// @param line_num Source line number, or -1
+/// @param eol Append linefeed "\n"
+/// @param fmt printf-style format string
bool logmsg(int log_level, const char *context, const char *func_name,
int line_num, bool eol, const char *fmt, ...)
FUNC_ATTR_UNUSED FUNC_ATTR_PRINTF(6, 7)
@@ -163,7 +175,8 @@ end:
FILE *open_log_file(void)
{
static bool opening_log_file = false;
- // check if it's a recursive call
+ // Disallow recursion. (This only matters for log_path_init; for logmsg and
+ // friends we use a mutex: log_lock).
if (opening_log_file) {
do_log_to_file(stderr, ERROR_LOG_LEVEL, NULL, __func__, __LINE__, true,
"Cannot LOG() recursively.");
diff --git a/src/nvim/map.c b/src/nvim/map.c
index 9b6f57a56f..90da27cf9f 100644
--- a/src/nvim/map.c
+++ b/src/nvim/map.c
@@ -1,12 +1,12 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
-///
-/// map.c: khash.h wrapper
-///
-/// NOTE: Callers must manage memory (allocate) for keys and values.
-/// khash.h does not make its own copy of the key or value.
-///
+//
+// map.c: khash.h wrapper
+//
+// NOTE: Callers must manage memory (allocate) for keys and values.
+// khash.h does not make its own copy of the key or value.
+//
#include <stdlib.h>
#include <stdbool.h>