#312 Option to "watch" active buffer added

Next_release
open
nobody
None
5
2014-08-17
2011-03-21
Pantalai
No

Hello,

Please find attached the .patch file for the option "Watch active buffer" added.

Feature description:
A new check box called "Watch active buffer" created inside group box "File Status Auto-Detection".
This option can be set using the Preferences window or a keyboard shortcut (CTRL+T).
Behavior:
Notepad++ verifies every 500ms if the active buffer (file) was changed outside of Notepad++.
For additional details please take a look at the updated documentation (\trunk\PowerEditor\misc\npp.help\HTML\Preferences.html).
Purpose of feature:
I found it useful for watching log files which are continuously modified.
Things still to improve:
- The timer period (500ms) is hard coded
- For files larger than 1 MB the updating period gets visible bigger than 500ms
- The redrawing process is visible (the views are blinking during the update, even if the watched file is relatively small - around 10KB)

Thank you and have a restful night or joyful day! :)
Bogdan

Discussion

  • Pantalai
    Pantalai
    2011-03-21

    patch file with modified source code and documentation files

     
  • Don HO
    Don HO
    2011-03-25

    Thank you for your patch.
    I 'd like to know what is more in "Watch active buffer" than "File Status Auto-Detection" ?

    Don

     
  • Pantalai
    Pantalai
    2011-03-26

    Hello Don,

    As far as I know "File Status Auto-Detection" checks if the file status is changed only when the Notepd++ changes from state inactive to state active (Npp receives WM_ACTIVATEAPP WM_MESSAGE). So, if I am opening a file and the Npp window is active and the file is changed by another application, Npp will not detect that the file status was changed.

    "Watch active buffer" periodically checks if the file status was changed.

    Take care,
    bogdan