File tree Expand file tree Collapse file tree
Core/Sources/SuggestionWidget/SuggestionPanelContent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,14 +400,15 @@ struct ChatPanelInputArea: View {
400400 }
401401
402402 func chatAutoCompletion( text: String , proposed: [ String ] , range: NSRange ) -> [ String ] {
403- if text. isEmpty { return [ ] }
403+ guard text. count == 1 else { return [ ] }
404404 let plugins = chat. pluginIdentifiers. map { " / \( $0) " }
405405 let availableFeatures = plugins + [
406406 " /exit " ,
407407 " @selection " ,
408408 " @file " ,
409409 ]
410- return availableFeatures
410+
411+ let result : [ String ] = availableFeatures
411412 . filter { $0. hasPrefix ( text) && $0 != text }
412413 . compactMap {
413414 guard let index = $0. index (
@@ -417,6 +418,7 @@ struct ChatPanelInputArea: View {
417418 ) else { return nil }
418419 return String ( $0 [ index... ] )
419420 }
421+ return result
420422 }
421423}
422424
You can’t perform that action at this time.
0 commit comments