diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-18 14:28:08 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-18 14:40:13 +0300 |
commit | 8fedd523deb07a33fc6ef786d57fd904ffecc8f5 (patch) | |
tree | 07cf57385ffc3f06fb328a2e9b827813773a6fb3 /src/qreg.h | |
parent | 70019f624a8d188cf30dcc8b1eb9440a6cffb49c (diff) | |
download | sciteco-8fedd523deb07a33fc6ef786d57fd904ffecc8f5.tar.gz |
fixed the "Editing local registers in macro calls" check
* The previous check could result in false positives if you are editing
a local Q-Register, that will be destroyed at the end of the current macro frame,
and call another non-colon modified macro.
* It must instead be invalid to keep the register edited only if it belongs to the
local Q-Registers that are about to be freed.
In other words, the table that the currently edited Q-Register belongs to, must be
the one we're about to destroy.
* This fixes the solarized.toggle (F5) macro when using the Solarized color scheme.
Diffstat (limited to 'src/qreg.h')
-rw-r--r-- | src/qreg.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -93,11 +93,11 @@ struct teco_qreg_t { teco_int_t integer; teco_doc_t string; - /* + /** * Whether to generate undo tokens (unnecessary for registers * in local qreg tables in macro invocations). * - * FIXME: Every QRegister has this field, but it only differs + * @fixme Every QRegister has this field, but it only differs * between local and global QRegisters. This wastes space. * Or by deferring any decision about undo token creation to a layer * that knows which table it is accessing. @@ -129,6 +129,7 @@ teco_qreg_free(teco_qreg_t *qreg) g_free(qreg); } +extern const teco_qreg_table_t *teco_qreg_table_current; extern teco_qreg_t *teco_qreg_current; /** @extends teco_rb3str_tree_t */ @@ -170,6 +171,7 @@ teco_qreg_table_edit(teco_qreg_table_t *table, teco_qreg_t *qreg, GError **error { if (!qreg->vtable->edit(qreg, error)) return FALSE; + teco_qreg_table_current = table; teco_qreg_current = qreg; return TRUE; } |