[BUG] Cursor position always moves to top of the file when opening a file

11 views
Skip to first unread message

Eduardo Sanchez

unread,
Apr 14, 2024, 1:20:31 PMApr 14
to spac...@googlegroups.com

Hello,

I want to report the following bug:

Description

When opening a file that was previously edited, the initial cursor position will be the top of the buffer.

Expected

(n)vim will recover the cursor position at the same place where it left when closing the buffer.

Actual

(n)vim doesn't recover previous cursor position and moves to the top of the buffer.

Additional information


I did a bisect and found that commit `49fff62e21b1c171fb3105fe7ade3c9bc8b71e23` is the start of the issue. I see there is change to use a history plugin instead of shada. I'm fine with the change as long as it works. I wonder if I need to configure something for the plugin or it may be a bug.

Additionally I've noticed that marks '" and `" always refer to the top of the file. So I can't use g'" as a workaround.

This happens in both vim and neovim.

Commit information


```bash
49fff62e21b1c171fb3105fe7ade3c9bc8b71e23 is the first bad commit
commit 49fff62e21b1c171fb3105fe7ade3c9bc8b71e23
Author: Eric Wong <er...@wsdjeg.net>
Date:   Thu Mar 14 11:08:00 2024 +0800

    feat(history)!: use history plugin instead of shada
    
    can not fix https://github.com/neovim/neovim/issues/6875
    
    always get error when open two nvim instances

 autoload/SpaceVim/autocmds.vim            | 14 ++++---
 autoload/SpaceVim/layers/core.vim         | 19 +++++++++-
 autoload/SpaceVim/layers/ui.vim           |  1 +
 autoload/SpaceVim/plugins/history.vim     | 62 +++++++++++++++++++++++++++++++
 bundle/vim-startify/autoload/startify.vim | 17 ++++-----
 bundle/vim-startify/syntax/startify.vim   |  2 +-
 docs/bundle-plugins.md                    |  8 ++--
 lua/spacevim/default.lua                  |  2 +
 8 files changed, 104 insertions(+), 21 deletions(-)
 create mode 100644 autoload/SpaceVim/plugins/history.vim

 ```

best,

Eduardo Sanchez


Eric Wong

unread,
Apr 18, 2024, 10:14:23 PMApr 18
to eduardo.daniel.s.m, spacevim
The pos info was saved in `~/.cache/SpaceVim/nvim_history.json`, can you check this file?
Reply all
Reply to author
Forward
0 new messages