aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/mark.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index 38495079e3..7c76bd2162 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -1349,10 +1349,11 @@ size_t mark_buffer_amount(const buf_T *const buf)
/// @return true on success, false on failure.
bool mark_set_global(const char name, const xfmark_T fm, const bool update)
{
- xfmark_T *fm_tgt = &(namedfm[mark_global_index(name)]);
- if (fm_tgt == &namedfm[0] - 1) {
+ const int idx = mark_global_index(name);
+ if (idx == -1) {
return false;
}
+ xfmark_T *const fm_tgt = &(namedfm[idx]);
if (update && fm.fmark.timestamp <= fm_tgt->fmark.timestamp) {
return false;
}