Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reload pop-up issue #111

Open
marilmanen opened this issue Jun 4, 2019 · 6 comments
Open

reload pop-up issue #111

marilmanen opened this issue Jun 4, 2019 · 6 comments

Comments

@marilmanen
Copy link
Contributor

marilmanen commented Jun 4, 2019

This is a strange issue.

I have a macro which modifies current file (running Perl script in xterm window) and as last command executes revert_to_saved(). After the macro is done (and has really executed the update_to_saved() subroutine) I get a "File modified externally" confirmation dialog and I don't think this should happen. The window content is already updated, so there's no point getting the external modification confirmation dialog.

Things get strange when I open Preferences/Default Settings/Customize Menus/Macro Menu
(just open it) and run exactly the same macro from the same Macro drop-down list as I did previously. Now I don't get the false pop-up confirmation window anymore. How can the opened "Macro Commands" window have any impact on the external file modification check?

I have tried to create an example macro, but I have failed on that. The issue seems to have a partly random behavior or at least I have not been able to create a simple macro that would always reproduce the issue.

@marilmanen
Copy link
Contributor Author

Some more debugging at it looks like the root cause might be that the external file change check is not disabled during macro execution, but it is disabled when the "Macro Commands" window is opened. I think that disabling external file change check during macro execution could solve my issue.

@eteran
Copy link
Owner

eteran commented Jun 4, 2019

Interesting, OK, I'll look into it.

Thanks!

@eteran
Copy link
Owner

eteran commented Sep 6, 2019

So I have gotten the spurious "file has changed" dialog a couple of times in personal usage, even with no macros involved... I will be looking into this issue. I imagine that this is a subtle issue.

@marilmanen
Copy link
Contributor Author

I found a simple way to get false externally modified file notification.

Macro/Learn Keystrokes
a
Ctrl+S
<newline>
Macro/Finish Learn

If I keep running this macro several times by keeping Ctrl+K pressed, the pop-up message of "file modified externally" will eventually come. I tried couple of times and fastest message came after 32 repeats and slowest after 694 repeats. With old NEdit I'm not able to get the message even after 3000 repeats and I also don't remember ever seeing a false externally modified file notification in the old NEdit. Hopefully this helps to find the root cause of these false messages

@marilmanen
Copy link
Contributor Author

I found a simpler way to reproduce the false externally modified file notification.
Macro with accelerator Ctrl+Shift+T

save()
replace_all(" *$", "x", "regex")

With an existing empty start file, the macro will work two times, but third execution gives the "Save as" "bar has been modified by another program. ...." pop-up window. Depending on the delay on pressing the "continue" button I get or don't get a second pop-up window "File modified externally". After the third macro execution it's very difficult to get the false pop.up windows anymore (I have seen it only once), unless I remove all text from the file and start from empty file, then the false pop-up windows will come on the third macro execution again.

@eteran
Copy link
Owner

eteran commented Jul 19, 2020

Awesome, thanks. I'll see if I can figure out what's triggering it and get a fix in there :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants