Skip to content

Commit 5236ce9

Browse files
committed
fix: update .gitignore to include IDE settings and improve code formatting in msgfmt.go
1 parent 0aa0367 commit 5236ce9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ snapshot2-*.log
66
schema.yaml
77
**/.claude/settings.local.json
88
out
9+
10+
11+
#IDEs
12+
.idea

lib/msgfmt/msgfmt.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package msgfmt
22

3-
import "strings"
3+
import (
4+
"strings"
5+
)
46

57
const WhiteSpaceChars = " \t\n\r\f\v"
68

@@ -166,6 +168,12 @@ func RemoveUserInput(msgRaw string, userInputRaw string) string {
166168
// Return the original message starting with the first line
167169
// that doesn't contain the echoed user input.
168170
lastUserInputLineIdx := msgRuneLineLocations[userInputEndIdx]
171+
172+
// In case of Gemini, the user input echoed back is wrapped in a rounded box, so we remove it.
173+
if strings.Contains(msgLines[lastUserInputLineIdx+1], "╯") && strings.Contains(msgLines[lastUserInputLineIdx+1], "╰") {
174+
lastUserInputLineIdx += 1
175+
}
176+
169177
return strings.Join(msgLines[lastUserInputLineIdx+1:], "\n")
170178
}
171179

@@ -201,6 +209,7 @@ const (
201209
)
202210

203211
func formatGenericMessage(message string, userInput string) string {
212+
//fmt.Println("Message:", message, "UserInput:", userInput)
204213
message = RemoveUserInput(message, userInput)
205214
message = removeMessageBox(message)
206215
message = trimEmptyLines(message)

0 commit comments

Comments
 (0)