Best way to "update" buffer

Looking to send a PR to the package-info plugin to address this odd quick. The plugin needs to read a file, but the file on disk could be out of date to what’s displayed in the buffer.

Currently, they “reload” the buffer by just calling :e, but this causes the cursor to jump from where ever it is to the start of the line.

Is there a better way to “update” the buffer, but without having a jumping cursor?

What about :e | execute 'normal! g`"'?

1 Like