From 3f60436d8431a41cf3218115856bc8400e661fa3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 3 Jul 2026 08:14:50 +0000 Subject: [PATCH] fix: check indentation with substring contains, not per-character contains(where:) on String iterates Characters; comparing each to multi-character strings like "\n " is a type error. Use tail.contains("\n ") || tail.contains("\t") instead. Co-authored-by: Rocky --- OSGKeyboardShared/Services/AppContextDetector.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OSGKeyboardShared/Services/AppContextDetector.swift b/OSGKeyboardShared/Services/AppContextDetector.swift index 844be95..d69906f 100644 --- a/OSGKeyboardShared/Services/AppContextDetector.swift +++ b/OSGKeyboardShared/Services/AppContextDetector.swift @@ -95,7 +95,7 @@ public struct AppContextDetector: Sendable { "if (", "if (", "} else", "} catch", "=> {", "-> {", ] - let hasIndentation = tail.contains(where: { $0 == "\n " || $0 == "\t" }) + let hasIndentation = tail.contains("\n ") || tail.contains("\t") let hasCodeKeyword = codeKeywords.contains(where: { tail.contains($0) }) if hasIndentation, hasCodeKeyword { return .code