aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/helpers.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-08-06 14:38:54 +0300
committerZyX <kp-pav@yandex.ru>2017-08-06 14:38:54 +0300
commit4d8ff5ec012cd517cf8010144f158d6f5c96d5bb (patch)
treecc7942bccd8e40c6a957d03a65d50c162b471fe0 /src/nvim/api/private/helpers.c
parenta356d3c89567dc13c5de70d33e5bcc534bf4c6cb (diff)
downloadrneovim-4d8ff5ec012cd517cf8010144f158d6f5c96d5bb.tar.gz
rneovim-4d8ff5ec012cd517cf8010144f158d6f5c96d5bb.tar.bz2
rneovim-4d8ff5ec012cd517cf8010144f158d6f5c96d5bb.zip
api/helpers: Clarify try_start() usage
Diffstat (limited to 'src/nvim/api/private/helpers.c')
-rw-r--r--src/nvim/api/private/helpers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index cdaceddc11..021d1d43ff 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -96,6 +96,13 @@ bool try_leave(const TryState *const tstate, Error *const err)
}
/// Start block that may cause vimscript exceptions
+///
+/// Each try_start() call should be mirrorred by try_end() call.
+///
+/// To be used as a replacement of `:try … catch … endtry` in C code, in cases
+/// when error flag could not already be set. If there may be pending error
+/// state at the time try_start() is executed which needs to be preserved,
+/// try_enter()/try_leave() pair should be used instead.
void try_start(void)
{
++trylevel;