Attached is a patch to fix the following problem:
steps to reproduce:
1. Mount a remote filesystem across the internet .
2. Open several files from that location via jEdit
3. Move focus to an application other than jEdit
4. Move focus back to jEdit
jEdit freezes for multiple seconds as the app checks file status for each buffer.
Buffer should be editable immediately.
The patch adds a combo box to GlobalOptionPane that controls when jEdit checks file status. The new option reads:
=== prompt ==
Check for file change upon:
=== values ==
application focus, visiting the buffer or saving any buffer
visiting the buffer or saving any buffer
visiting or saving the buffer
saving the buffer
State for this configuration option is stored in a new integer property named 'checkFileStatus'.
The patch implements this new behavior.
In case you're curious, here's a short description of the use case satisfied by each option:
Making 'application focus' the default option avoids introducing new overhead and retains behavior that plugins may expect. This option could be dropped if those goals aren't important.
The 'application focus, visiting[...]' option is useful in an environment where multiple users may edit a file simultaneously.
The 'visiting the buffer or saving any buffer' option defers notification of file changes until the user is at a natural pausing point in workflow.
The 'visiting or saving the buffer' option deals well with many files where checking file attributes has high latency, such as in the sshfs-attached filesystem scenario that motivated this patch.
The 'saving the buffer' option disables checking file attributes except during save and exit. This can be helpful when a network-attached filesystem is intermittently unavailable or unresponsive.
I use sshfs w/ compression enabled.