aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2015-08-09 21:22:27 +0300
committerZyX <kp-pav@yandex.ru>2015-10-08 22:00:36 +0300
commit4371842bcc0e5384d29a25a495c66691dae0cec5 (patch)
tree6591b7537384d864140dd7c7580d39808dcc70c2 /src
parent830c8bd23e693a9081ea7ebeb11b415822b1e3b3 (diff)
downloadrneovim-4371842bcc0e5384d29a25a495c66691dae0cec5.tar.gz
rneovim-4371842bcc0e5384d29a25a495c66691dae0cec5.tar.bz2
rneovim-4371842bcc0e5384d29a25a495c66691dae0cec5.zip
shada: Call regtilde when reading last replacement string
Diffstat (limited to 'src')
-rw-r--r--src/nvim/shada.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index 8789ab8772..2a2fb07b89 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -41,6 +41,7 @@
#include "nvim/ex_getln.h"
#include "nvim/search.h"
#include "nvim/eval.h"
+#include "nvim/regexp.h"
#include "nvim/eval_defs.h"
#include "nvim/version.h"
#include "nvim/path.h"
@@ -85,6 +86,7 @@ KHASH_SET_INIT_STR(strset)
#define os_getperm(f) \
(os_getperm((char_u *) f))
#define os_isdir(f) (os_isdir((char_u *) f))
+#define regtilde(s, m) ((char *) regtilde((char_u *) s, m))
#define path_tail_with_sep(f) ((char *) path_tail_with_sep((char_u *)f))
// From http://www.boost.org/doc/libs/1_43_0/boost/detail/endian.hpp + some
@@ -1289,6 +1291,11 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
.timestamp = cur_entry.timestamp,
.additional_elements = cur_entry.data.sub_string.additional_elements,
});
+ // Without using regtilde and without / &cpo flag previous substitute
+ // string is close to useless: you can only use it with :& or :~ and
+ // that’s all because s//~ is not available until the first call to
+ // regtilde. Vim was not calling this for some reason.
+ (void) regtilde(cur_entry.data.sub_string.sub, p_magic);
// Do not free shada entry: its allocated memory was saved above.
break;
}