@Skif-off
* `update_editor_menu` – GeanyLua is capable of sending signals to other Geany
components. So it could send a signal to a component that could interact with
the menu. Or a user may wish to take some other action that doesn't require
direct interaction with the menu. Lack of creativity does not make it useless.
* `key_press` – Are you having a *real* problem with the signal, or is this
just hypothetical? On a properly functioning system, checking whether the file
exists takes a negligible amount of time.
On my computer, it takes just under a second on average to check for a
nonexistent file a million times (code at the end of thie message). That's
about 0.001 *nano*seconds per keystroke. That amounts to about 4.38 min of
processing for someone typing at 100 wpm for a year *non-stop*. I've already
lost more time just reading your messages than I would have lost to the plugin
over *many* years of normal use.
```
#include <time.h>
clock_t begin = clock();
for (int i = 0 ; i < 1000000 ; ++i) {
char * file_does_not_exist = g_strconcat(geany->app->configdir,
"file_does_not_exist", NULL);
g_file_test(file_does_not_exist, G_FILE_TEST_IS_REGULAR);
}
clock_t end = clock();
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
msgwin_status_add("time_spent = %f", time_spent);
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1112#issuecomment-933399566