From a9077cd2654489b485bd857198fd1f422b11524c Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Sun, 27 Sep 2020 15:02:56 +0200 Subject: [PATCH] Disable auto replaces that match an empty string. Some people are having problems with these suddenly showing up and making typing impossible. This doesn't fix the cause of the ARs appearing, but it at least prevents it from making MSE unusable. --- CHANGES.md | 1 + src/data/word_list.cpp | 6 ++++++ src/data/word_list.hpp | 2 ++ 3 files changed, 9 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 0d0fc887..3118afb3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ HEAD: new items added as changes are made Bug fixes: * Fixed: crash in expand_keywords when given empty tags (#90) * Fixed: tab traversal in native look editors (style and set info tabs) (#98) + * Auto replaces that match "" are now disabled ------------------------------------------------------------------------------ version 2.1.1, 2020-06-14 diff --git a/src/data/word_list.cpp b/src/data/word_list.cpp index 24550479..c898a879 100644 --- a/src/data/word_list.cpp +++ b/src/data/word_list.cpp @@ -49,3 +49,9 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(AutoReplace) { REFLECT(match); REFLECT(replace); } + +void after_reading(AutoReplace& ar, Version) { + if (ar.match.empty()) { + ar.enabled = false; + } +} \ No newline at end of file diff --git a/src/data/word_list.hpp b/src/data/word_list.hpp index 801f7ebd..5099206a 100644 --- a/src/data/word_list.hpp +++ b/src/data/word_list.hpp @@ -58,3 +58,5 @@ public: DECLARE_REFLECTION(); }; +void after_reading(AutoReplace& ar, Version); +