From 983d6be8d4114e94b7e47a65674c11d877b68cec Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 30 Dec 2019 16:58:53 +0300 Subject: [PATCH] Added rpl::event_stream for firing applied markdown tag to spellchecker. --- ui/widgets/input_fields.cpp | 4 ++++ ui/widgets/input_fields.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ui/widgets/input_fields.cpp b/ui/widgets/input_fields.cpp index fb6b171..db17e0c 100644 --- a/ui/widgets/input_fields.cpp +++ b/ui/widgets/input_fields.cpp @@ -3152,6 +3152,10 @@ bool InputField::commitMarkdownReplacement( cursor.setCharFormat(_defaultCharFormat); _inner->setTextCursor(cursor); + + // Fire the tag to the spellchecker. + _markdownTagApplies.fire({ from, till, -1, -1, false, tag }); + return true; } diff --git a/ui/widgets/input_fields.h b/ui/widgets/input_fields.h index 4fd9dbc..2873ea7 100644 --- a/ui/widgets/input_fields.h +++ b/ui/widgets/input_fields.h @@ -330,6 +330,9 @@ public: auto documentContentsChanges() { return _documentContentsChanges.events(); } + auto markdownTagApplies() { + return _markdownTagApplies.events(); + } ~InputField(); @@ -535,6 +538,7 @@ private: bool _instantReplacesEnabled = true; rpl::event_stream _documentContentsChanges; + rpl::event_stream _markdownTagApplies; };