Skip to content

Commit

Permalink
fix(lsp): fix behavior when inline code is a first string on the line
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahlir committed Apr 4, 2024
1 parent 2bf9b5d commit d3aab27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/adapter/lsp/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ func (d *document) DocumentLinkAt(pos protocol.Position) (*documentLink, error)
return nil, nil
}

// Recursive function to check whether a link is within inline code block.
// Recursive function to check whether a link is within inline code.
func linkWithinInlineCode(strBuffer string, linkStart, linkEnd int, insideInline bool) bool {
if backtickId := strings.Index(strBuffer, "`"); backtickId > 0 && backtickId < linkEnd {
if backtickId := strings.Index(strBuffer, "`"); backtickId >= 0 && backtickId < linkEnd {
return linkWithinInlineCode(strBuffer[backtickId+1:],
linkStart-backtickId-1, linkEnd-backtickId-1, !insideInline)
} else {
Expand Down

0 comments on commit d3aab27

Please sign in to comment.