aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-07-18 01:59:46 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-07-18 01:59:46 +0300
commitcf7e3bc51731ea4be786ec163532a63d7f93af87 (patch)
tree3810d36f390a36f00838c318273565aa4b9f65d6 /src
parent5d4368584ecd447b953e8853dbeaee4282700970 (diff)
downloadsciteco-cf7e3bc51731ea4be786ec163532a63d7f93af87.tar.gz
<nEL> (set EOL mode) now sets the buffer's dirty flag
* While it doesn't directly change the buffer's contents in bytes, a subsequent write would result in a different file on disk, so it is consequent to remind the user of saving or discarding changes. * Will also fix :EX after changing the EOL mode.
Diffstat (limited to 'src')
-rw-r--r--src/core-commands.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core-commands.c b/src/core-commands.c
index ae51ecc..287a9a3 100644
--- a/src/core-commands.c
+++ b/src/core-commands.c
@@ -2337,6 +2337,13 @@ teco_state_ecommand_eol(teco_machine_main_t *ctx, GError **error)
undo__teco_interface_ssm(SCI_SETEOLMODE,
teco_interface_ssm(SCI_GETEOLMODE, 0, 0), 0);
teco_interface_ssm(SCI_SETEOLMODE, eol_mode, 0);
+
+ /*
+ * While the buffer contents were not changed,
+ * the result of saving the file may differ,
+ * so we still dirtify the buffer.
+ */
+ teco_ring_dirtify();
} else if (teco_machine_main_eval_colon(ctx) > 0) {
const gchar *eol_seq = teco_eol_get_seq(teco_interface_ssm(SCI_GETEOLMODE, 0, 0));
teco_expressions_push(eol_seq);