mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
shada: Run set_last_cursor before writing shada file
This commit is contained in:
@@ -877,7 +877,8 @@ was made yet in the current file.
|
|||||||
for each opened file.
|
for each opened file.
|
||||||
Only one position is remembered per buffer, not one
|
Only one position is remembered per buffer, not one
|
||||||
for each window. As long as the buffer is visible in
|
for each window. As long as the buffer is visible in
|
||||||
a window the position won't be changed.
|
a window the position won't be changed. Mark is also
|
||||||
|
reset when |:wshada| is run.
|
||||||
|
|
||||||
*'^* *`^*
|
*'^* *`^*
|
||||||
'^ `^ To the position where the cursor was the last time
|
'^ `^ To the position where the cursor was the last time
|
||||||
|
@@ -1169,6 +1169,8 @@ running) you have additional options:
|
|||||||
cannot write ShaDa file!" check that no old temp files
|
cannot write ShaDa file!" check that no old temp files
|
||||||
were left behind (e.g. ~/.nvim/shada/main.shada.tmp*).
|
were left behind (e.g. ~/.nvim/shada/main.shada.tmp*).
|
||||||
|
|
||||||
|
Note: Executing :wshada will reset all |'quote| marks.
|
||||||
|
|
||||||
*:wv* *:wviminfo*
|
*:wv* *:wviminfo*
|
||||||
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
|
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
|
||||||
|
|
||||||
|
@@ -2433,6 +2433,15 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
|
|||||||
msgpack_packer *const packer = msgpack_packer_new(sd_writer,
|
msgpack_packer *const packer = msgpack_packer_new(sd_writer,
|
||||||
&msgpack_sd_writer_write);
|
&msgpack_sd_writer_write);
|
||||||
|
|
||||||
|
// Set b_last_cursor for all the buffers that have a window.
|
||||||
|
//
|
||||||
|
// It is needed to correctly save '"' mark on exit. Has a side effect of
|
||||||
|
// setting '"' mark in all windows on :wshada to the current cursor
|
||||||
|
// position (basically what :wviminfo used to do).
|
||||||
|
FOR_ALL_TAB_WINDOWS(tp, wp) {
|
||||||
|
set_last_cursor(wp);
|
||||||
|
}
|
||||||
|
|
||||||
FOR_ALL_BUFFERS(buf) {
|
FOR_ALL_BUFFERS(buf) {
|
||||||
if (buf->b_ffname != NULL && shada_removable((char *) buf->b_ffname)) {
|
if (buf->b_ffname != NULL && shada_removable((char *) buf->b_ffname)) {
|
||||||
int kh_ret;
|
int kh_ret;
|
||||||
|
Reference in New Issue
Block a user