Skip to content

Commit

Permalink
Fix a bug where ! would trigger ChatGPT in Markdown documents
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Feb 12, 2023
1 parent cd9ded3 commit 2213e71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions v2/keyloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,9 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
shouldUseAI := false
if e.AtOrAfterEndOfLine() {
for _, triggerWord := range triggerWordsForAI {
if triggerWord == "!" && e.mode == mode.Markdown {
continue
}
if strings.HasPrefix(trimmedLine, e.SingleLineCommentMarker()+" "+triggerWord+" ") {
shouldUseAI = true
break
Expand Down

0 comments on commit 2213e71

Please sign in to comment.