How to reload file after it has been changed outside of ne?

19 views
Skip to first unread message

jason404

unread,
May 20, 2020, 1:04:33 PM5/20/20
to niceeditor
I can't see any command which reloads the current file after it being edited outside of ne.  Is there any way of doing this without having to close and open it again?

Thanks,

todd_...@unc.edu

unread,
May 20, 2020, 1:30:17 PM5/20/20
to niceeditor
The way I do it is to issue the "Open" command (Menu: File->open; Command line: ^k O <enter>; kb shortcut: ^o).

The file requester is presented. Hit escape, and the current document's name is presented on the command line. Just hit <enter>. It'll ask you if you're sure. Hit 'y' and enter. So altogether it's
  ^o <Esc> <enter> y

Probably not as elegant as you would like, but it's also not something you should have to do that often.

jason404

unread,
May 20, 2020, 1:43:20 PM5/20/20
to niceeditor
Okay, thanks Todd.

Jamie Lentin

unread,
May 22, 2020, 5:02:11 AM5/22/20
to nicee...@googlegroups.com
A related issue that annoys me from time to time is I'd like to see a
diff of ne's buffer versus what's on the file system.

For example, after a git rebase will report "File has been modified
since buffer was loaded or saved; are you sure?", since the timestamps
have changed. It would be nice to spawn diff to see if pressing 'y' will
make a mess of my rebase or change nothing but the timestamp.

This feels like it should be possible with a macro, something like
"through diff -u (original file) - | less" but I've not come up with a
formulation that doesn't involve patches to ne. I could have a go at
implementing something but it's hard to know what:

1) Building it into ne, adding a "d" option to the "are you sure?"
option above. Nicest for me, but then you have to configure the diff
tool, is very single-purpose, and you may well want to just check
separately.
2) An option to system that pumps the whole buffer to stdin when running
the command, "system-pipe-stdin diff -u (original file) -"
3) A command to dump the buffer to a given temporary file, "dump_buffer
/tmp/unsaved ; system diff -u (original file) /tmp/unsaved ; rm
/tmp/unsaved"

...I'm not sure if there's an existing way of doing "(original file)"
either. If there isn't, possibly system could set an environment
variable in the shell it sends the command to, to save having to
implement variable substitution?

Or it could be I'm missing something obvious. It wouldn't be the first
time :)

Cheers,
> --
> You received this message because you are subscribed to the Google
> Groups "niceeditor" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to niceeditor+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/niceeditor/08b78966-78f5-47c2-af75-ae370eb9d7d9%40googlegroups.com
> [1].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/niceeditor/08b78966-78f5-47c2-af75-ae370eb9d7d9%40googlegroups.com?utm_medium=email&utm_source=footer
Reply all
Reply to author
Forward
0 new messages