-
-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
Description
Hi,
Thanks for the great plugin!
I found a small issue that is slightly annoying.
With the following file
$ sudo chown root hello.txt
$ cat hello.txt
a
b
c
keep_cursor_here_on_exit
d
e
And the following minimal neovim config file
$ cat my_init.vim
set runtimepath^=./vim
let &packpath = &runtimepath
call plug#begin('./vim/plugged')
Plug 'lambdalisue/vim-suda'
call plug#end()
" Enable auto sudo write
let g:suda_smart_edit = 1
If i open the file with
$ nvim -u ./my_init.vim ./hello.txt
navigate to the keep_cursor_here_on_exit line, exit neovim, then open it again, and run the To the cursor position when last exiting the current buffer command aka,
`"
the cursor is placed on the line containing c rather than keep_cursor_here_on_exit.
In contrast, if the file is owned by my user, and SudaRead is not executed, going to the last exit mark successfully goes to the keep_cursor_here_on_exit line.
I'm guessing vim-suda somehow modifies the last exit line mark during its execution.