From 501c7d6793cc27d995dfcae3a54b769d2a5eb718 Mon Sep 17 00:00:00 2001 From: blewjy Date: Thu, 21 Mar 2019 18:03:43 +0800 Subject: [PATCH] Disabled auto suggestion for slash commands when not first word --- .../Chat/MessagesViewControllerComposerDelegate.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Rocket.Chat/Controllers/Chat/MessagesViewControllerComposerDelegate.swift b/Rocket.Chat/Controllers/Chat/MessagesViewControllerComposerDelegate.swift index cf292ea7de..e47e5ae2d2 100644 --- a/Rocket.Chat/Controllers/Chat/MessagesViewControllerComposerDelegate.swift +++ b/Rocket.Chat/Controllers/Chat/MessagesViewControllerComposerDelegate.swift @@ -36,6 +36,12 @@ extension MessagesViewController: ComposerViewExpandedDelegate { // MARK: Hints func composerView(_ composerView: ComposerView, didChangeHintPrefixedWord word: String) { + + // Don't generate hints if it is a slash command and not the first word + if word.first == "/" && composerView.textView.text != word { + return + } + composerViewModel.didChangeHintPrefixedWord(word: word) if composerViewModel.hints.count > 0 {