Miscellaneous Bug Fixes (#423)

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 <jakub.bortlik@proton.me>
This commit is contained in:
Harrison (Harry) Cramer
2024-11-12 11:01:28 -05:00
committed by GitHub
parent 30daecfb60
commit be027331e1
17 changed files with 221 additions and 11079 deletions

View File

@@ -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"`
@@ -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,
}

View File

@@ -7,7 +7,7 @@ import (
"io"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"
@@ -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)

1
cmd/config/emojis.json Normal file

File diff suppressed because one or more lines are too long