Fix multiline mentions (#27649)
This commit is contained in:
@@ -126,6 +126,12 @@ describe("run prompt shared", () => {
|
||||
expect(mentionTriggerIndex("👨👩👧👦 @src", Bun.stringWidth("👨👩👧👦 @src"))).toBe(3)
|
||||
expect(displayCharAt("👨👩👧👦 @src", Bun.stringWidth("👨👩👧👦 @"))).toBe("s")
|
||||
expect(displaySlice("👨👩👧👦 @src", 3, Bun.stringWidth("👨👩👧👦 @src"))).toBe("@src")
|
||||
expect(mentionTriggerIndex("@file1\n@file2", 13)).toBe(7)
|
||||
expect(displayCharAt("@file1\n@file2", 6)).toBe("\n")
|
||||
expect(displaySlice("@file1\n@file2", 8, 13)).toBe("file2")
|
||||
expect(mentionTriggerIndex("@file1\nfoo @file2", 17)).toBe(11)
|
||||
expect(mentionTriggerIndex("中文 @one\n@two", 14)).toBe(10)
|
||||
expect(displaySlice("中文 @one\n@two", 11, 14)).toBe("two")
|
||||
expect(mentionTriggerIndex("中文@")).toBeUndefined()
|
||||
expect(mentionTriggerIndex("こんにちは@")).toBeUndefined()
|
||||
expect(mentionTriggerIndex("한국어@")).toBeUndefined()
|
||||
|
||||
Reference in New Issue
Block a user