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 From 9cf9c4a5860212cc0f9b71d349849811fdaf61a1 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 6 Jul 2015 02:16:05 +0300 Subject: Replace references to viminfo in various places --- src/nvim/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/fileio.c') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index e4b59b7316..38442e3ab3 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -2172,7 +2172,7 @@ readfile_charconvert ( */ static void check_marks_read(void) { - if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 + if (!curbuf->b_marks_read && get_shada_parameter('\'') > 0 && curbuf->b_ffname != NULL) { shada_read_marks(); } -- cgit From 8663983cc4c2f66eb0ba58ad8e247ac0686cc79b Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 6 Jul 2015 02:26:44 +0300 Subject: Deprecate &viminfo and :[rw]v, add &shada and :[rw]sh --- src/nvim/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/fileio.c') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 38442e3ab3..a7472b40e2 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -2177,7 +2177,7 @@ static void check_marks_read(void) shada_read_marks(); } - /* Always set b_marks_read; needed when 'viminfo' is changed to include + /* Always set b_marks_read; needed when 'shada' is changed to include * the ' parameter after opening a buffer. */ curbuf->b_marks_read = true; } -- cgit