Skip to content

Commit

Permalink
Miscellaneous Bug Fixes (#423)
Browse files Browse the repository at this point in the history
fix: Show non-resolvable notes in winbar (#417)
fix: add more emojis and make emoji picker configurable (#414)
fix: comment creation should not be possible for renamed and moved files (#416)
fix: color highlight groups are invalid (#421)
fix: plugin failing to build on Windows (#419)

---------

Co-authored-by: Jakub F. Bortlík <[email protected]>
  • Loading branch information
harrisoncramer and jakubbortlik authored Nov 12, 2024
1 parent 30daecf commit be02733
Show file tree
Hide file tree
Showing 17 changed files with 221 additions and 11,079 deletions.
9 changes: 8 additions & 1 deletion cmd/app/comment_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type LineRange struct {
/* PositionData represents the position of a comment or note (relative to a file diff) */
type PositionData struct {
FileName string `json:"file_name"`
OldFileName string `json:"old_file_name"`
NewLine *int `json:"new_line,omitempty"`
OldLine *int `json:"old_line,omitempty"`
HeadCommitSHA string `json:"head_commit_sha"`
Expand All @@ -41,13 +42,19 @@ type RequestWithPosition interface {
func buildCommentPosition(commentWithPositionData RequestWithPosition) *gitlab.PositionOptions {
positionData := commentWithPositionData.GetPositionData()

// If the file has been renamed, then this is a relevant part of the payload
oldFileName := positionData.OldFileName
if oldFileName == "" {
oldFileName = positionData.FileName
}

opt := &gitlab.PositionOptions{
PositionType: &positionData.Type,
StartSHA: &positionData.StartCommitSHA,
HeadSHA: &positionData.HeadCommitSHA,
BaseSHA: &positionData.BaseCommitSHA,
NewPath: &positionData.FileName,
OldPath: &positionData.FileName,
OldPath: &oldFileName,
NewLine: positionData.NewLine,
OldLine: positionData.OldLine,
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/app/emoji.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"

Expand Down Expand Up @@ -157,8 +157,8 @@ func attachEmojis(a *data, fr FileReader) error {
return err
}

binPath := path.Dir(e)
filePath := fmt.Sprintf("%s/config/emojis.json", binPath)
binPath := filepath.Dir(e)
filePath := filepath.Join(binPath, "config", "emojis.json")

reader, err := fr.ReadFile(filePath)

Expand Down
1 change: 1 addition & 0 deletions cmd/config/emojis.json

Large diffs are not rendered by default.

Loading

0 comments on commit be02733

Please sign in to comment.