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); +