I am trying to write a plugin that will make a system
call that generates a file based on the current buffer and then open the generated file in vsplit
or, if it is already open, it will update it when the original file changes.
I have the code to such an extent that it generates a file and opens / updates the division, but the problem is that when it first opens the division, the focus moves to the split and when it updates the cursor position on the source the file goes to the top of the page.
Here is what I am trying, any help would be greatly appreciated.
execute 'keepjumps silent ! ' . s:cmd . ' ' . s:src_file . ' > ' . s:dst_file if exists("s:outputbufnr") && bufexists(s:outputbufnr) execute 'keepjumps ' . bufwinnr(s:outputbufnr) else " execute "keepjumps vnew " s:dst_file execute "keepjumps rightbelow vertical new " . s:dst_file let s:outputbufnr=bufnr(s:dst_file) endif
From the fact that although keepjumps
should return the cursor to its previous position, this does not seem to be the case.
source share