aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-07-28 02:41:33 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-07-28 02:41:33 +0300
commit86fbf212de71a83e7bb4d83a4b33e54bed52dff9 (patch)
tree1afd4168fa4448ff369181fe1e8b3d69472a1d2a /src/main.c
parentafc50684cdb38815573fdff0f4fff47cc4eb00a8 (diff)
downloadsciteco-86fbf212de71a83e7bb4d83a4b33e54bed52dff9.tar.gz
`ED&2` can be used to access the program termination flag now
* `0,2ED` is roughly equivalent to `-EX` * `ED&2` can be used to query whether EX has been run. This is useful if macros can run EX. * `2,0ED` could be used to cancel the effect of EX. * But the real motivation is for implementing a REPL script.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index c8ac27b..a04d1d1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -506,7 +506,8 @@ main(int argc, char **argv)
goto cleanup;
g_clear_error(&error);
- if (teco_quit_requested) {
+ if (teco_ed & TECO_ED_EXIT) {
+ /* exit was requested using the EX command */
if (!teco_expressions_pop_num_calc(&ret, EXIT_SUCCESS, &error) ||
!teco_ed_hook(TECO_ED_HOOK_QUIT, &error))
goto cleanup;