From 244dbe3a77bf548f73d8781da7327f30e818b08a Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 25 Apr 2015 18:47:31 +0300 Subject: viminfo: First version of ShaDa file dumping What works: 1. ShaDa file dumping: header, registers, jump list, history, search patterns, substitute strings, variables. 2. ShaDa file reading: registers, global marks, variables. Most was not tested. TODO: 1. Merging. 2. Reading history, local marks, jump and buffer lists. 3. Documentation update. 4. Converting some data from &encoding. 5. Safer variant of dumping viminfo (dump to temporary file then rename). 6. Removing old viminfo code (currently masked with `#if 0` in a ShaDa file for reference). --- src/nvim/fileio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nvim/fileio.c') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 302f6b30fb..e4b59b7316 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -57,6 +57,7 @@ #include "nvim/types.h" #include "nvim/undo.h" #include "nvim/window.h" +#include "nvim/shada.h" #include "nvim/os/os.h" #include "nvim/os/time.h" #include "nvim/os/input.h" @@ -2166,14 +2167,15 @@ readfile_charconvert ( /* - * Read marks for the current buffer from the viminfo file, when we support + * Read marks for the current buffer from the ShaDa file, when we support * buffer marks and the buffer has a name. */ static void check_marks_read(void) { if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 - && curbuf->b_ffname != NULL) - read_viminfo(NULL, VIF_WANT_MARKS); + && curbuf->b_ffname != NULL) { + shada_read_marks(); + } /* Always set b_marks_read; needed when 'viminfo' is changed to include * the ' parameter after opening a buffer. */ -- cgit