Author Topic: "Refresh" Option for open files  (Read 4270 times)

rowbearto

  • Senior Community Member
  • Posts: 2337
  • Hero Points: 132
"Refresh" Option for open files
« on: February 23, 2018, 09:45:09 PM »
SE is usually pretty good at auto-reloading files, but sometimes I'm not sure SE loaded the latest version. I also sometimes see notifications that SE stopped doing auto-reload on some files.

Would be nice if SE could provide a "refresh" button, so that I can force SE to reread the latest contents of the file (especially if it is a logfile written by another process).

rowbearto

  • Senior Community Member
  • Posts: 2337
  • Hero Points: 132
Re: "Refresh" Option for open files
« Reply #1 on: February 24, 2018, 04:07:29 PM »
I think I found there is a Slick-C function to reload files - _ReloadCurFile2() ?

I wrapped it into a command, and it seems to work for reloading files:

Code: [Select]
_command void reloadCurrentBuffer() name_info(',' VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL)
{
    _ReloadCurFile2();
}

Is this the correct approach?

rowbearto

  • Senior Community Member
  • Posts: 2337
  • Hero Points: 132
Re: "Refresh" Option for open files
« Reply #2 on: February 27, 2018, 04:33:17 PM »
The revert_or_refresh() function is available for this - for more details see: https://community.slickedit.com/index.php/topic,16010.msg61367.html#msg61367