diff --git a/go.mod b/go.mod index 510be94406b33df9f2acacff36987d38c2d76b0d..2b5ae191dff16e8aba8d1d617f457d178cec2dfd 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/alecthomas/chroma/v2 v2.15.0 github.com/anthropics/anthropic-sdk-go v1.4.0 - github.com/aymanbagabas/go-udiff v0.2.0 + github.com/aymanbagabas/go-udiff v0.3.1 github.com/bmatcuk/doublestar/v4 v4.8.1 github.com/charlievieth/fastwalk v1.0.11 github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250607113720-eb5e1cf3b09e @@ -18,6 +18,7 @@ require ( github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.1.0.20250523195325-2d1af06b557c github.com/charmbracelet/x/ansi v0.9.3-0.20250602153603-fb931ed90413 github.com/charmbracelet/x/exp/charmtone v0.0.0-20250530202730-6ba1785cd7b9 + github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec github.com/fsnotify/fsnotify v1.8.0 github.com/go-logfmt/logfmt v0.6.0 @@ -65,7 +66,7 @@ require ( github.com/aymerick/douceur v0.2.0 // indirect github.com/charmbracelet/colorprofile v0.3.1 // indirect github.com/charmbracelet/x/cellbuf v0.0.14-0.20250516160309-24eee56f89fa // indirect - github.com/charmbracelet/x/exp/slice v0.0.0-20250528180458-2d5d6cb84620 + github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef github.com/charmbracelet/x/input v0.3.5-0.20250509021451-13796e822d86 // indirect github.com/charmbracelet/x/term v0.2.1 // indirect github.com/charmbracelet/x/windows v0.2.1 // indirect diff --git a/go.sum b/go.sum index 91812419d46dbf3030ae03374c0664868317d0ca..30700694188b65dc5908fa77b0f77153eaead541 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= -github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= +github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY= +github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/bmatcuk/doublestar/v4 v4.8.1 h1:54Bopc5c2cAvhLRAzqOGCYHYyhcDHsFF4wWIR5wKP38= @@ -86,8 +86,8 @@ github.com/charmbracelet/x/exp/charmtone v0.0.0-20250530202730-6ba1785cd7b9 h1:f github.com/charmbracelet/x/exp/charmtone v0.0.0-20250530202730-6ba1785cd7b9/go.mod h1:vr+xCFylsPYq2qSz+n5/jItjcK2/PgrKFMTI7VRR6CI= github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a h1:FsHEJ52OC4VuTzU8t+n5frMjLvpYWEznSr/u8tnkCYw= github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= -github.com/charmbracelet/x/exp/slice v0.0.0-20250528180458-2d5d6cb84620 h1:/PN4jqP3ki9NvtHRrYZ9ewCutKZB6DK8frTW+Dj/MWs= -github.com/charmbracelet/x/exp/slice v0.0.0-20250528180458-2d5d6cb84620/go.mod h1:vI5nDVMWi6veaYH+0Fmvpbe/+cv/iJfMntdh+N0+Tms= +github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef h1:v7qwsZ2OxzlwvpKwz8dtZXp7fIJlcDEUOyFBNE4fz4Q= +github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef/go.mod h1:vI5nDVMWi6veaYH+0Fmvpbe/+cv/iJfMntdh+N0+Tms= github.com/charmbracelet/x/input v0.3.5-0.20250509021451-13796e822d86 h1:BxAEmOBIDajkgao3EsbBxKQCYvgYPGdT62WASLvtf4Y= github.com/charmbracelet/x/input v0.3.5-0.20250509021451-13796e822d86/go.mod h1:62Rp/6EtTxoeJDSdtpA3tJp3y3ZRpsiekBSje+K8htA= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= diff --git a/internal/exp/diffview/Taskfile.yaml b/internal/exp/diffview/Taskfile.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f27d093565d7e0e00fb265e21e3ccb2ce48c65b1 --- /dev/null +++ b/internal/exp/diffview/Taskfile.yaml @@ -0,0 +1,102 @@ +version: "3" + +tasks: + test: + desc: Run tests + cmds: + - go test ./... {{.CLI_ARGS}} + + test:update: + desc: Run tests and update golden files + cmds: + - go test ./... -update {{.CLI_ARGS}} + + test:print: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffView/**/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:width:unified: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewWidth/Unified/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:width:split: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewWidth/Split/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:height:unified: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewHeight/Unified/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:height:split: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewHeight/Split/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:xoffset:unified: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewXOffset/Unified/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:xoffset:split: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewXOffset/Split/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:yoffset:unified: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewYOffset/Unified/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true + + test:print:yoffset:split: + desc: Print golden files for debugging + method: none + sources: + - ./testdata/TestDiffViewYOffset/Split/*.golden + cmds: + - for: sources + cmd: echo && echo "------- {{.ITEM}} -------" && echo && cat {{.ITEM}} + silent: true diff --git a/internal/exp/diffview/chroma.go b/internal/exp/diffview/chroma.go new file mode 100644 index 0000000000000000000000000000000000000000..e4d6b2dbaa12651b28ace04e2e051c7a64522899 --- /dev/null +++ b/internal/exp/diffview/chroma.go @@ -0,0 +1,52 @@ +package diffview + +import ( + "fmt" + "image/color" + "io" + + "github.com/alecthomas/chroma/v2" + "github.com/charmbracelet/lipgloss/v2" +) + +var _ chroma.Formatter = chromaFormatter{} + +// chromaFormatter is a custom formatter for Chroma that uses Lip Gloss for +// foreground styling, while keeping a forced background color. +type chromaFormatter struct { + bgColor color.Color +} + +// Format implements the chroma.Formatter interface. +func (c chromaFormatter) Format(w io.Writer, style *chroma.Style, it chroma.Iterator) error { + for token := it(); token != chroma.EOF; token = it() { + entry := style.Get(token.Type) + if entry.IsZero() { + if _, err := fmt.Fprint(w, token.Value); err != nil { + return err + } + continue + } + + s := lipgloss.NewStyle(). + Background(c.bgColor) + + if entry.Bold == chroma.Yes { + s = s.Bold(true) + } + if entry.Underline == chroma.Yes { + s = s.Underline(true) + } + if entry.Italic == chroma.Yes { + s = s.Italic(true) + } + if entry.Colour.IsSet() { + s = s.Foreground(lipgloss.Color(entry.Colour.String())) + } + + if _, err := fmt.Fprint(w, s.Render(token.Value)); err != nil { + return err + } + } + return nil +} diff --git a/internal/exp/diffview/diffview.go b/internal/exp/diffview/diffview.go new file mode 100644 index 0000000000000000000000000000000000000000..6e8fe858d10455a85455ec371b421ef272d78d9e --- /dev/null +++ b/internal/exp/diffview/diffview.go @@ -0,0 +1,681 @@ +package diffview + +import ( + "fmt" + "image/color" + "strconv" + "strings" + + "github.com/alecthomas/chroma/v2" + "github.com/alecthomas/chroma/v2/lexers" + "github.com/aymanbagabas/go-udiff" + "github.com/aymanbagabas/go-udiff/myers" + "github.com/charmbracelet/lipgloss/v2" + "github.com/charmbracelet/x/ansi" +) + +const ( + leadingSymbolsSize = 2 + lineNumPadding = 1 +) + +type file struct { + path string + content string +} + +type layout int + +const ( + layoutUnified layout = iota + 1 + layoutSplit +) + +// DiffView represents a view for displaying differences between two files. +type DiffView struct { + layout layout + before file + after file + contextLines int + lineNumbers bool + highlight bool + height int + width int + xOffset int + yOffset int + style Style + tabWidth int + chromaStyle *chroma.Style + + isComputed bool + err error + unified udiff.UnifiedDiff + edits []udiff.Edit + + splitHunks []splitHunk + + codeWidth int + fullCodeWidth int // with leading symbols + extraColOnAfter bool // add extra column on after panel + beforeNumDigits int + afterNumDigits int +} + +// New creates a new DiffView with default settings. +func New() *DiffView { + dv := &DiffView{ + layout: layoutUnified, + contextLines: udiff.DefaultContextLines, + lineNumbers: true, + tabWidth: 8, + } + dv.style = DefaultDarkStyle() + return dv +} + +// Unified sets the layout of the DiffView to unified. +func (dv *DiffView) Unified() *DiffView { + dv.layout = layoutUnified + return dv +} + +// Split sets the layout of the DiffView to split (side-by-side). +func (dv *DiffView) Split() *DiffView { + dv.layout = layoutSplit + return dv +} + +// Before sets the "before" file for the DiffView. +func (dv *DiffView) Before(path, content string) *DiffView { + dv.before = file{path: path, content: content} + return dv +} + +// After sets the "after" file for the DiffView. +func (dv *DiffView) After(path, content string) *DiffView { + dv.after = file{path: path, content: content} + return dv +} + +// ContextLines sets the number of context lines for the DiffView. +func (dv *DiffView) ContextLines(contextLines int) *DiffView { + dv.contextLines = contextLines + return dv +} + +// Style sets the style for the DiffView. +func (dv *DiffView) Style(style Style) *DiffView { + dv.style = style + return dv +} + +// LineNumbers sets whether to display line numbers in the DiffView. +func (dv *DiffView) LineNumbers(lineNumbers bool) *DiffView { + dv.lineNumbers = lineNumbers + return dv +} + +// SyntaxHightlight sets whether to enable syntax highlighting in the DiffView. +func (dv *DiffView) SyntaxHightlight(highlight bool) *DiffView { + dv.highlight = highlight + return dv +} + +// Height sets the height of the DiffView. +func (dv *DiffView) Height(height int) *DiffView { + dv.height = height + return dv +} + +// Width sets the width of the DiffView. +func (dv *DiffView) Width(width int) *DiffView { + dv.width = width + return dv +} + +// XOffset sets the horizontal offset for the DiffView. +func (dv *DiffView) XOffset(xOffset int) *DiffView { + dv.xOffset = xOffset + return dv +} + +// YOffset sets the vertical offset for the DiffView. +func (dv *DiffView) YOffset(yOffset int) *DiffView { + dv.yOffset = yOffset + return dv +} + +// TabWidth sets the tab width. Only relevant for code that contains tabs, like +// Go code. +func (dv *DiffView) TabWidth(tabWidth int) *DiffView { + dv.tabWidth = tabWidth + return dv +} + +// ChromaStyle sets the chroma style for syntax highlighting. +// If nil, no syntax highlighting will be applied. +func (dv *DiffView) ChromaStyle(style *chroma.Style) *DiffView { + dv.chromaStyle = style + return dv +} + +// String returns the string representation of the DiffView. +func (dv *DiffView) String() string { + dv.replaceTabs() + if err := dv.computeDiff(); err != nil { + return err.Error() + } + dv.convertDiffToSplit() + dv.adjustStyles() + dv.detectNumDigits() + + if dv.width <= 0 { + dv.detectCodeWidth() + } else { + dv.resizeCodeWidth() + } + + style := lipgloss.NewStyle() + if dv.width > 0 { + style = style.MaxWidth(dv.width) + } + if dv.height > 0 { + style = style.MaxHeight(dv.height) + } + + switch dv.layout { + case layoutUnified: + return style.Render(strings.TrimSuffix(dv.renderUnified(), "\n")) + case layoutSplit: + return style.Render(strings.TrimSuffix(dv.renderSplit(), "\n")) + default: + panic("unknown diffview layout") + } +} + +// replaceTabs replaces tabs in the before and after file contents with spaces +// according to the specified tab width. +func (dv *DiffView) replaceTabs() { + spaces := strings.Repeat(" ", dv.tabWidth) + dv.before.content = strings.ReplaceAll(dv.before.content, "\t", spaces) + dv.after.content = strings.ReplaceAll(dv.after.content, "\t", spaces) +} + +// computeDiff computes the differences between the "before" and "after" files. +func (dv *DiffView) computeDiff() error { + if dv.isComputed { + return dv.err + } + dv.isComputed = true + dv.edits = myers.ComputeEdits( //nolint:staticcheck + dv.before.content, + dv.after.content, + ) + dv.unified, dv.err = udiff.ToUnifiedDiff( + dv.before.path, + dv.after.path, + dv.before.content, + dv.edits, + dv.contextLines, + ) + return dv.err +} + +// convertDiffToSplit converts the unified diff to a split diff if the layout is +// set to split. +func (dv *DiffView) convertDiffToSplit() { + if dv.layout != layoutSplit { + return + } + + dv.splitHunks = make([]splitHunk, len(dv.unified.Hunks)) + for i, h := range dv.unified.Hunks { + dv.splitHunks[i] = hunkToSplit(h) + } +} + +// adjustStyles adjusts adds padding and alignment to the styles. +func (dv *DiffView) adjustStyles() { + setPadding := func(s lipgloss.Style) lipgloss.Style { + return s.Padding(0, lineNumPadding).Align(lipgloss.Right) + } + dv.style.MissingLine.LineNumber = setPadding(dv.style.MissingLine.LineNumber) + dv.style.DividerLine.LineNumber = setPadding(dv.style.DividerLine.LineNumber) + dv.style.EqualLine.LineNumber = setPadding(dv.style.EqualLine.LineNumber) + dv.style.InsertLine.LineNumber = setPadding(dv.style.InsertLine.LineNumber) + dv.style.DeleteLine.LineNumber = setPadding(dv.style.DeleteLine.LineNumber) +} + +// detectNumDigits calculates the maximum number of digits needed for before and +// after line numbers. +func (dv *DiffView) detectNumDigits() { + dv.beforeNumDigits = 0 + dv.afterNumDigits = 0 + + for _, h := range dv.unified.Hunks { + dv.beforeNumDigits = max(dv.beforeNumDigits, len(strconv.Itoa(h.FromLine+len(h.Lines)))) + dv.afterNumDigits = max(dv.afterNumDigits, len(strconv.Itoa(h.ToLine+len(h.Lines)))) + } +} + +// detectCodeWidth calculates the maximum width of code lines in the diff view. +func (dv *DiffView) detectCodeWidth() { + switch dv.layout { + case layoutUnified: + dv.detectUnifiedCodeWidth() + case layoutSplit: + dv.detectSplitCodeWidth() + } + dv.fullCodeWidth = dv.codeWidth + leadingSymbolsSize +} + +// detectUnifiedCodeWidth calculates the maximum width of code lines in a +// unified diff. +func (dv *DiffView) detectUnifiedCodeWidth() { + dv.codeWidth = 0 + + for _, h := range dv.unified.Hunks { + shownLines := ansi.StringWidth(dv.hunkLineFor(h)) + + for _, l := range h.Lines { + lineWidth := ansi.StringWidth(strings.TrimSuffix(l.Content, "\n")) + 1 + dv.codeWidth = max(dv.codeWidth, lineWidth, shownLines) + } + } +} + +// detectSplitCodeWidth calculates the maximum width of code lines in a +// split diff. +func (dv *DiffView) detectSplitCodeWidth() { + dv.codeWidth = 0 + + for i, h := range dv.splitHunks { + shownLines := ansi.StringWidth(dv.hunkLineFor(dv.unified.Hunks[i])) + + for _, l := range h.lines { + if l.before != nil { + codeWidth := ansi.StringWidth(strings.TrimSuffix(l.before.Content, "\n")) + 1 + dv.codeWidth = max(dv.codeWidth, codeWidth, shownLines) + } + if l.after != nil { + codeWidth := ansi.StringWidth(strings.TrimSuffix(l.after.Content, "\n")) + 1 + dv.codeWidth = max(dv.codeWidth, codeWidth, shownLines) + } + } + } +} + +// resizeCodeWidth resizes the code width to fit within the specified width. +func (dv *DiffView) resizeCodeWidth() { + fullNumWidth := dv.beforeNumDigits + dv.afterNumDigits + fullNumWidth += lineNumPadding * 4 // left and right padding for both line numbers + + switch dv.layout { + case layoutUnified: + dv.codeWidth = dv.width - fullNumWidth - leadingSymbolsSize + case layoutSplit: + remainingWidth := dv.width - fullNumWidth - leadingSymbolsSize*2 + dv.codeWidth = remainingWidth / 2 + dv.extraColOnAfter = isOdd(remainingWidth) + } + + dv.fullCodeWidth = dv.codeWidth + leadingSymbolsSize +} + +// renderUnified renders the unified diff view as a string. +func (dv *DiffView) renderUnified() string { + var b strings.Builder + + fullContentStyle := lipgloss.NewStyle().MaxWidth(dv.fullCodeWidth) + printedLines := -dv.yOffset + + write := func(s string) { + if printedLines >= 0 { + b.WriteString(s) + } + } + +outer: + for i, h := range dv.unified.Hunks { + ls := dv.style.DividerLine + if dv.lineNumbers { + write(ls.LineNumber.Render(pad("…", dv.beforeNumDigits))) + write(ls.LineNumber.Render(pad("…", dv.afterNumDigits))) + } + content := ansi.Truncate(dv.hunkLineFor(h), dv.fullCodeWidth, "…") + write(ls.Code.Width(dv.fullCodeWidth).Render(content)) + write("\n") + printedLines++ + + beforeLine := h.FromLine + afterLine := h.ToLine + + for j, l := range h.Lines { + // print ellipis if we don't have enough space to print the rest of the diff + hasReachedHeight := dv.height > 0 && printedLines+1 == dv.height + isLastHunk := i+1 == len(dv.unified.Hunks) + isLastLine := j+1 == len(h.Lines) + if hasReachedHeight && (!isLastHunk || !isLastLine) { + ls := dv.lineStyleForType(l.Kind) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad("…", dv.beforeNumDigits))) + write(ls.LineNumber.Render(pad("…", dv.afterNumDigits))) + } + write(fullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth).Render(" …"), + )) + write("\n") + break outer + } + + getContent := func(ls LineStyle) string { + content := strings.TrimSuffix(l.Content, "\n") + content = dv.hightlightCode(content, ls.Code.GetBackground()) + content = ansi.GraphemeWidth.Cut(content, dv.xOffset, len(content)) + content = ansi.Truncate(content, dv.codeWidth, "…") + return content + } + + leadingEllipsis := dv.xOffset > 0 && strings.TrimSpace(content) != "" + + switch l.Kind { + case udiff.Equal: + ls := dv.style.EqualLine + content := getContent(ls) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(beforeLine, dv.beforeNumDigits))) + write(ls.LineNumber.Render(pad(afterLine, dv.afterNumDigits))) + } + write(fullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth).Render(ternary(leadingEllipsis, " …", " ") + content), + )) + beforeLine++ + afterLine++ + case udiff.Insert: + ls := dv.style.InsertLine + content := getContent(ls) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(" ", dv.beforeNumDigits))) + write(ls.LineNumber.Render(pad(afterLine, dv.afterNumDigits))) + } + write(fullContentStyle.Render( + ls.Symbol.Render(ternary(leadingEllipsis, "+…", "+ ")) + + ls.Code.Width(dv.codeWidth).Render(content), + )) + afterLine++ + case udiff.Delete: + ls := dv.style.DeleteLine + content := getContent(ls) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(beforeLine, dv.beforeNumDigits))) + write(ls.LineNumber.Render(pad(" ", dv.afterNumDigits))) + } + write(fullContentStyle.Render( + ls.Symbol.Render(ternary(leadingEllipsis, "-…", "- ")) + + ls.Code.Width(dv.codeWidth).Render(content), + )) + beforeLine++ + } + write("\n") + + printedLines++ + } + } + + for printedLines < dv.height { + ls := dv.style.MissingLine + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(" ", dv.beforeNumDigits))) + write(ls.LineNumber.Render(pad(" ", dv.afterNumDigits))) + } + write(ls.Code.Width(dv.fullCodeWidth).Render(" ")) + write("\n") + printedLines++ + } + + return b.String() +} + +// renderSplit renders the split (side-by-side) diff view as a string. +func (dv *DiffView) renderSplit() string { + var b strings.Builder + + beforeFullContentStyle := lipgloss.NewStyle().MaxWidth(dv.fullCodeWidth) + afterFullContentStyle := lipgloss.NewStyle().MaxWidth(dv.fullCodeWidth + btoi(dv.extraColOnAfter)) + printedLines := -dv.yOffset + + write := func(s string) { + if printedLines >= 0 { + b.WriteString(s) + } + } + +outer: + for i, h := range dv.splitHunks { + ls := dv.style.DividerLine + if dv.lineNumbers { + write(ls.LineNumber.Render(pad("…", dv.beforeNumDigits))) + } + content := ansi.Truncate(dv.hunkLineFor(dv.unified.Hunks[i]), dv.fullCodeWidth, "…") + write(ls.Code.Width(dv.fullCodeWidth).Render(content)) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad("…", dv.afterNumDigits))) + } + write(ls.Code.Width(dv.fullCodeWidth + btoi(dv.extraColOnAfter)).Render(" ")) + write("\n") + printedLines++ + + beforeLine := h.fromLine + afterLine := h.toLine + + for j, l := range h.lines { + // print ellipis if we don't have enough space to print the rest of the diff + hasReachedHeight := dv.height > 0 && printedLines+1 == dv.height + isLastHunk := i+1 == len(dv.unified.Hunks) + isLastLine := j+1 == len(h.lines) + if hasReachedHeight && (!isLastHunk || !isLastLine) { + ls := dv.style.MissingLine + if l.before != nil { + ls = dv.lineStyleForType(l.before.Kind) + } + if dv.lineNumbers { + write(ls.LineNumber.Render(pad("…", dv.beforeNumDigits))) + } + write(beforeFullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth).Render(" …"), + )) + ls = dv.style.MissingLine + if l.after != nil { + ls = dv.lineStyleForType(l.after.Kind) + } + if dv.lineNumbers { + write(ls.LineNumber.Render(pad("…", dv.afterNumDigits))) + } + write(afterFullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth).Render(" …"), + )) + write("\n") + break outer + } + + getContent := func(content string, ls LineStyle) string { + content = strings.TrimSuffix(content, "\n") + content = dv.hightlightCode(content, ls.Code.GetBackground()) + content = ansi.GraphemeWidth.Cut(content, dv.xOffset, len(content)) + content = ansi.Truncate(content, dv.codeWidth, "…") + return content + } + getLeadingEllipsis := func(content string) bool { + return dv.xOffset > 0 && strings.TrimSpace(content) != "" + } + + switch { + case l.before == nil: + ls := dv.style.MissingLine + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(" ", dv.beforeNumDigits))) + } + write(beforeFullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth).Render(" "), + )) + case l.before.Kind == udiff.Equal: + ls := dv.style.EqualLine + content := getContent(l.before.Content, ls) + leadingEllipsis := getLeadingEllipsis(content) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(beforeLine, dv.beforeNumDigits))) + } + write(beforeFullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth).Render(ternary(leadingEllipsis, " …", " ") + content), + )) + beforeLine++ + case l.before.Kind == udiff.Delete: + ls := dv.style.DeleteLine + content := getContent(l.before.Content, ls) + leadingEllipsis := getLeadingEllipsis(content) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(beforeLine, dv.beforeNumDigits))) + } + write(beforeFullContentStyle.Render( + ls.Symbol.Render(ternary(leadingEllipsis, "-…", "- ")) + + ls.Code.Width(dv.codeWidth).Render(content), + )) + beforeLine++ + } + + switch { + case l.after == nil: + ls := dv.style.MissingLine + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(" ", dv.afterNumDigits))) + } + write(afterFullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth + btoi(dv.extraColOnAfter)).Render(" "), + )) + case l.after.Kind == udiff.Equal: + ls := dv.style.EqualLine + content := getContent(l.after.Content, ls) + leadingEllipsis := getLeadingEllipsis(content) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(afterLine, dv.afterNumDigits))) + } + write(afterFullContentStyle.Render( + ls.Code.Width(dv.fullCodeWidth + btoi(dv.extraColOnAfter)).Render(ternary(leadingEllipsis, " …", " ") + content), + )) + afterLine++ + case l.after.Kind == udiff.Insert: + ls := dv.style.InsertLine + content := getContent(l.after.Content, ls) + leadingEllipsis := getLeadingEllipsis(content) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(afterLine, dv.afterNumDigits))) + } + write(afterFullContentStyle.Render( + ls.Symbol.Render(ternary(leadingEllipsis, "+…", "+ ")) + + ls.Code.Width(dv.codeWidth+btoi(dv.extraColOnAfter)).Render(content), + )) + afterLine++ + } + + write("\n") + + printedLines++ + } + } + + for printedLines < dv.height { + ls := dv.style.MissingLine + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(" ", dv.beforeNumDigits))) + } + write(ls.Code.Width(dv.fullCodeWidth).Render(" ")) + if dv.lineNumbers { + write(ls.LineNumber.Render(pad(" ", dv.afterNumDigits))) + } + write(ls.Code.Width(dv.fullCodeWidth + btoi(dv.extraColOnAfter)).Render(" ")) + write("\n") + printedLines++ + } + + return b.String() +} + +// hunkLineFor formats the header line for a hunk in the unified diff view. +func (dv *DiffView) hunkLineFor(h *udiff.Hunk) string { + beforeShownLines, afterShownLines := dv.hunkShownLines(h) + + return fmt.Sprintf( + " @@ -%d,%d +%d,%d @@ ", + h.FromLine, + beforeShownLines, + h.ToLine, + afterShownLines, + ) +} + +// hunkShownLines calculates the number of lines shown in a hunk for both before +// and after versions. +func (dv *DiffView) hunkShownLines(h *udiff.Hunk) (before, after int) { + for _, l := range h.Lines { + switch l.Kind { + case udiff.Equal: + before++ + after++ + case udiff.Insert: + after++ + case udiff.Delete: + before++ + } + } + return +} + +func (dv *DiffView) lineStyleForType(t udiff.OpKind) LineStyle { + switch t { + case udiff.Equal: + return dv.style.EqualLine + case udiff.Insert: + return dv.style.InsertLine + case udiff.Delete: + return dv.style.DeleteLine + default: + return dv.style.MissingLine + } +} + +func (dv *DiffView) hightlightCode(source string, bgColor color.Color) string { + if dv.chromaStyle == nil { + return source + } + + l := dv.getChromaLexer(source) + f := dv.getChromaFormatter(bgColor) + + it, err := l.Tokenise(nil, source) + if err != nil { + return source + } + + var b strings.Builder + if err := f.Format(&b, dv.chromaStyle, it); err != nil { + return source + } + return b.String() +} + +func (dv *DiffView) getChromaLexer(source string) chroma.Lexer { + l := lexers.Match(dv.before.path) + if l == nil { + l = lexers.Analyse(source) + } + if l == nil { + l = lexers.Fallback + } + return chroma.Coalesce(l) +} + +func (dv *DiffView) getChromaFormatter(gbColor color.Color) chroma.Formatter { + return chromaFormatter{ + bgColor: gbColor, + } +} diff --git a/internal/exp/diffview/diffview_test.go b/internal/exp/diffview/diffview_test.go new file mode 100644 index 0000000000000000000000000000000000000000..28e84716624d4b0f9efdc4044da74e438cf04b33 --- /dev/null +++ b/internal/exp/diffview/diffview_test.go @@ -0,0 +1,300 @@ +package diffview_test + +import ( + _ "embed" + "fmt" + "strings" + "testing" + + "github.com/alecthomas/chroma/v2/styles" + "github.com/charmbracelet/crush/internal/exp/diffview" + "github.com/charmbracelet/x/ansi" + "github.com/charmbracelet/x/exp/golden" +) + +//go:embed testdata/TestDefault.before +var TestDefaultBefore string + +//go:embed testdata/TestDefault.after +var TestDefaultAfter string + +//go:embed testdata/TestMultipleHunks.before +var TestMultipleHunksBefore string + +//go:embed testdata/TestMultipleHunks.after +var TestMultipleHunksAfter string + +//go:embed testdata/TestNarrow.before +var TestNarrowBefore string + +//go:embed testdata/TestNarrow.after +var TestNarrowAfter string + +//go:embed testdata/TestTabs.before +var TestTabsBefore string + +//go:embed testdata/TestTabs.after +var TestTabsAfter string + +type ( + TestFunc func(dv *diffview.DiffView) *diffview.DiffView + TestFuncs map[string]TestFunc +) + +var ( + UnifiedFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv.Unified() + } + SplitFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv.Split() + } + + DefaultFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("main.go", TestDefaultBefore). + After("main.go", TestDefaultAfter) + } + NoLineNumbersFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("main.go", TestDefaultBefore). + After("main.go", TestDefaultAfter). + LineNumbers(false) + } + MultipleHunksFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter) + } + CustomContextLinesFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter). + ContextLines(4) + } + NarrowFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("text.txt", TestNarrowBefore). + After("text.txt", TestNarrowAfter) + } + SmallWidthFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter). + Width(40) + } + LargeWidthFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter). + Width(120) + } + NoSyntaxHighlightFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter). + ChromaStyle(nil) + } + + LightModeFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Style(diffview.DefaultLightStyle()). + ChromaStyle(styles.Get("catppuccin-latte")) + } + DarkModeFunc = func(dv *diffview.DiffView) *diffview.DiffView { + return dv. + Style(diffview.DefaultDarkStyle()). + ChromaStyle(styles.Get("catppuccin-macchiato")) + } + + LayoutFuncs = TestFuncs{ + "Unified": UnifiedFunc, + "Split": SplitFunc, + } + BehaviorFuncs = TestFuncs{ + "Default": DefaultFunc, + "NoLineNumbers": NoLineNumbersFunc, + "MultipleHunks": MultipleHunksFunc, + "CustomContextLines": CustomContextLinesFunc, + "Narrow": NarrowFunc, + "SmallWidth": SmallWidthFunc, + "LargeWidth": LargeWidthFunc, + "NoSyntaxHighlight": NoSyntaxHighlightFunc, + } + ThemeFuncs = TestFuncs{ + "LightMode": LightModeFunc, + "DarkMode": DarkModeFunc, + } +) + +func TestDiffView(t *testing.T) { + for layoutName, layoutFunc := range LayoutFuncs { + t.Run(layoutName, func(t *testing.T) { + for behaviorName, behaviorFunc := range BehaviorFuncs { + t.Run(behaviorName, func(t *testing.T) { + for themeName, themeFunc := range ThemeFuncs { + t.Run(themeName, func(t *testing.T) { + t.Parallel() + + dv := diffview.New() + dv = layoutFunc(dv) + dv = themeFunc(dv) + dv = behaviorFunc(dv) + + output := dv.String() + golden.RequireEqual(t, []byte(output)) + + switch behaviorName { + case "SmallWidth": + assertLineWidth(t, 40, output) + case "LargeWidth": + assertLineWidth(t, 120, output) + } + }) + } + }) + } + }) + } +} + +func TestDiffViewTabs(t *testing.T) { + for layoutName, layoutFunc := range LayoutFuncs { + t.Run(layoutName, func(t *testing.T) { + t.Parallel() + + dv := diffview.New(). + Before("main.go", TestTabsBefore). + After("main.go", TestTabsAfter). + Style(diffview.DefaultLightStyle()). + ChromaStyle(styles.Get("catppuccin-latte")) + dv = layoutFunc(dv) + + output := dv.String() + golden.RequireEqual(t, []byte(output)) + }) + } +} + +func TestDiffViewWidth(t *testing.T) { + for layoutName, layoutFunc := range LayoutFuncs { + t.Run(layoutName, func(t *testing.T) { + for width := 1; width <= 110; width++ { + if layoutName == "Unified" && width > 60 { + continue + } + + t.Run(fmt.Sprintf("WidthOf%03d", width), func(t *testing.T) { + t.Parallel() + + dv := diffview.New(). + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter). + Width(width). + Style(diffview.DefaultLightStyle()). + ChromaStyle(styles.Get("catppuccin-latte")) + dv = layoutFunc(dv) + + output := dv.String() + golden.RequireEqual(t, []byte(output)) + + assertLineWidth(t, width, output) + }) + } + }) + } +} + +func TestDiffViewHeight(t *testing.T) { + for layoutName, layoutFunc := range LayoutFuncs { + t.Run(layoutName, func(t *testing.T) { + for height := 1; height <= 20; height++ { + t.Run(fmt.Sprintf("HeightOf%03d", height), func(t *testing.T) { + t.Parallel() + + dv := diffview.New(). + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter). + Height(height). + Style(diffview.DefaultLightStyle()). + ChromaStyle(styles.Get("catppuccin-latte")) + dv = layoutFunc(dv) + + output := dv.String() + golden.RequireEqual(t, []byte(output)) + + assertHeight(t, height, output) + }) + } + }) + } +} + +func TestDiffViewXOffset(t *testing.T) { + for layoutName, layoutFunc := range LayoutFuncs { + t.Run(layoutName, func(t *testing.T) { + for xOffset := range 21 { + t.Run(fmt.Sprintf("XOffsetOf%02d", xOffset), func(t *testing.T) { + t.Parallel() + + dv := diffview.New(). + Before("main.go", TestDefaultBefore). + After("main.go", TestDefaultAfter). + Style(diffview.DefaultLightStyle()). + ChromaStyle(styles.Get("catppuccin-latte")). + Width(60). + XOffset(xOffset) + dv = layoutFunc(dv) + + output := dv.String() + golden.RequireEqual(t, []byte(output)) + + assertLineWidth(t, 60, output) + }) + } + }) + } +} + +func TestDiffViewYOffset(t *testing.T) { + for layoutName, layoutFunc := range LayoutFuncs { + t.Run(layoutName, func(t *testing.T) { + for yOffset := range 17 { + t.Run(fmt.Sprintf("YOffsetOf%02d", yOffset), func(t *testing.T) { + t.Parallel() + + dv := diffview.New(). + Before("main.go", TestMultipleHunksBefore). + After("main.go", TestMultipleHunksAfter). + Style(diffview.DefaultLightStyle()). + ChromaStyle(styles.Get("catppuccin-latte")). + Height(5). + YOffset(yOffset) + dv = layoutFunc(dv) + + output := dv.String() + golden.RequireEqual(t, []byte(output)) + + assertHeight(t, 5, output) + }) + } + }) + } +} + +func assertLineWidth(t *testing.T, expected int, output string) { + var lineWidth int + for line := range strings.SplitSeq(output, "\n") { + lineWidth = max(lineWidth, ansi.StringWidth(line)) + } + if lineWidth != expected { + t.Errorf("expected output width to be == %d, got %d", expected, lineWidth) + } +} + +func assertHeight(t *testing.T, expected int, output string) { + output = strings.TrimSuffix(output, "\n") + lines := strings.Count(output, "\n") + 1 + if lines != expected { + t.Errorf("expected output height to be == %d, got %d", expected, lines) + } +} diff --git a/internal/exp/diffview/split.go b/internal/exp/diffview/split.go new file mode 100644 index 0000000000000000000000000000000000000000..9099afb425ac9bfa2236fbc464d5370d56580f25 --- /dev/null +++ b/internal/exp/diffview/split.go @@ -0,0 +1,74 @@ +package diffview + +import ( + "slices" + + "github.com/aymanbagabas/go-udiff" + "github.com/charmbracelet/x/exp/slice" +) + +type splitHunk struct { + fromLine int + toLine int + lines []*splitLine +} + +type splitLine struct { + before *udiff.Line + after *udiff.Line +} + +func hunkToSplit(h *udiff.Hunk) (sh splitHunk) { + lines := slices.Clone(h.Lines) + sh = splitHunk{ + fromLine: h.FromLine, + toLine: h.ToLine, + lines: make([]*splitLine, 0, len(lines)), + } + + for { + var ul udiff.Line + var ok bool + ul, lines, ok = slice.Shift(lines) + if !ok { + break + } + + var sl splitLine + + switch ul.Kind { + + // For equal lines, add as is + case udiff.Equal: + sl.before = &ul + sl.after = &ul + + // For inserted lines, set after and keep before as nil + case udiff.Insert: + sl.before = nil + sl.after = &ul + + // For deleted lines, set before and loop over the next lines + // searching for the equivalent after line. + case udiff.Delete: + sl.before = &ul + + inner: + for i, l := range lines { + switch l.Kind { + case udiff.Insert: + var ll udiff.Line + ll, lines, _ = slice.DeleteAt(lines, i) + sl.after = &ll + break inner + case udiff.Equal: + break inner + } + } + } + + sh.lines = append(sh.lines, &sl) + } + + return +} diff --git a/internal/exp/diffview/style.go b/internal/exp/diffview/style.go new file mode 100644 index 0000000000000000000000000000000000000000..e24f67ec7f1aee809cb058ca11268562ff00d74e --- /dev/null +++ b/internal/exp/diffview/style.go @@ -0,0 +1,124 @@ +package diffview + +import ( + "github.com/charmbracelet/lipgloss/v2" + "github.com/charmbracelet/x/exp/charmtone" +) + +// LineStyle defines the styles for a given line type in the diff view. +type LineStyle struct { + LineNumber lipgloss.Style + Symbol lipgloss.Style + Code lipgloss.Style +} + +// Style defines the overall style for the diff view, including styles for +// different line types such as divider, missing, equal, insert, and delete +// lines. +type Style struct { + DividerLine LineStyle + MissingLine LineStyle + EqualLine LineStyle + InsertLine LineStyle + DeleteLine LineStyle +} + +// DefaultLightStyle provides a default light theme style for the diff view. +func DefaultLightStyle() Style { + return Style{ + DividerLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Iron). + Background(charmtone.Thunder), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Oyster). + Background(charmtone.Anchovy), + }, + MissingLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Background(charmtone.Ash), + Code: lipgloss.NewStyle(). + Background(charmtone.Ash), + }, + EqualLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Charcoal). + Background(charmtone.Ash), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Pepper). + Background(charmtone.Salt), + }, + InsertLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Turtle). + Background(lipgloss.Color("#c8e6c9")), + Symbol: lipgloss.NewStyle(). + Foreground(charmtone.Turtle). + Background(lipgloss.Color("#e8f5e9")), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Pepper). + Background(lipgloss.Color("#e8f5e9")), + }, + DeleteLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Cherry). + Background(lipgloss.Color("#ffcdd2")), + Symbol: lipgloss.NewStyle(). + Foreground(charmtone.Cherry). + Background(lipgloss.Color("#ffebee")), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Pepper). + Background(lipgloss.Color("#ffebee")), + }, + } +} + +// DefaultDarkStyle provides a default dark theme style for the diff view. +func DefaultDarkStyle() Style { + return Style{ + DividerLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Smoke). + Background(charmtone.Sapphire), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Smoke). + Background(charmtone.Ox), + }, + MissingLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Background(charmtone.Charcoal), + Code: lipgloss.NewStyle(). + Background(charmtone.Charcoal), + }, + EqualLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Ash). + Background(charmtone.Charcoal), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Salt). + Background(charmtone.Pepper), + }, + InsertLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Turtle). + Background(lipgloss.Color("#293229")), + Symbol: lipgloss.NewStyle(). + Foreground(charmtone.Turtle). + Background(lipgloss.Color("#303a30")), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Salt). + Background(lipgloss.Color("#303a30")), + }, + DeleteLine: LineStyle{ + LineNumber: lipgloss.NewStyle(). + Foreground(charmtone.Cherry). + Background(lipgloss.Color("#332929")), + Symbol: lipgloss.NewStyle(). + Foreground(charmtone.Cherry). + Background(lipgloss.Color("#3a3030")), + Code: lipgloss.NewStyle(). + Foreground(charmtone.Salt). + Background(lipgloss.Color("#3a3030")), + }, + } +} diff --git a/internal/exp/diffview/testdata/TestDefault.after b/internal/exp/diffview/testdata/TestDefault.after new file mode 100644 index 0000000000000000000000000000000000000000..f5cedbfb45f13c7e15835782ddfdc511adb769c0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDefault.after @@ -0,0 +1,10 @@ +package main + +import ( + "fmt" +) + +func main() { + content := "Hello, world!" + fmt.Println(content) +} diff --git a/internal/exp/diffview/testdata/TestDefault.before b/internal/exp/diffview/testdata/TestDefault.before new file mode 100644 index 0000000000000000000000000000000000000000..5dc991b75fcbbc9a47076de46349322816027e86 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDefault.before @@ -0,0 +1,9 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println("Hello, world!") +} diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/CustomContextLines/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/CustomContextLines/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..698ca85f639a3611eeb3964c3be994b66ea73bb1 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/CustomContextLines/DarkMode.golden @@ -0,0 +1,16 @@ +  …  @@ -1,13 +1,15 @@    …    +  1  package main   1  package main  +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  8   fmt.Println(getContent())   9   fmt.Println(getContent())  +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/CustomContextLines/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/CustomContextLines/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..e548d553e1fc3bfb41c7b84bcb5a3f813cd7ae66 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/CustomContextLines/LightMode.golden @@ -0,0 +1,16 @@ +  …  @@ -1,13 +1,15 @@    …    +  1  package main   1  package main  +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  8   fmt.Println(getContent())   9   fmt.Println(getContent())  +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/Default/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/Default/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..b00b47a18b46163593bcb105cea18dbb4661f966 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/Default/DarkMode.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  )   5  )  +  6     6    +  7  func main() {   7  func main() {  +  8 -  fmt.Println("Hello, world!")   8 +  content := "Hello, world!"  +       9 +  fmt.Println(content)  +  9  }  10  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/Default/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/Default/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..1d5472609c01435393837ff441dcf9834ae561ae --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/Default/LightMode.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  )   5  )  +  6     6    +  7  func main() {   7  func main() {  +  8 -  fmt.Println("Hello, world!")   8 +  content := "Hello, world!"  +       9 +  fmt.Println(content)  +  9  }  10  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/LargeWidth/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/LargeWidth/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..5058ab2079c8c27905c07929ec1b854549dfa9f0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/LargeWidth/DarkMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/LargeWidth/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/LargeWidth/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..54be547a1c74b34e4bfc1fd3ee84d946bd7603d5 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/LargeWidth/LightMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/MultipleHunks/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/MultipleHunks/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..818863adc9081bcd2b66b0029f3a72a994d618e5 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/MultipleHunks/DarkMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/MultipleHunks/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/MultipleHunks/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..376bae2594d8e175cdd84b90846fe43c639c4d69 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/MultipleHunks/LightMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/Narrow/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/Narrow/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..5b5a7815e5a6ca092036595df1a3cb30d644e8c9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/Narrow/DarkMode.golden @@ -0,0 +1,4 @@ + …  @@ -1,3 +1,3 @@   …    + 1 - a  1 + d  + 2 - b  2 + e  + 3 - c  3 + f  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/Narrow/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/Narrow/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..4ece6dca5318253fbc8af76e89a3fe41fc87009b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/Narrow/LightMode.golden @@ -0,0 +1,4 @@ + …  @@ -1,3 +1,3 @@   …    + 1 - a  1 + d  + 2 - b  2 + e  + 3 - c  3 + f  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/NoLineNumbers/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/NoLineNumbers/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..ce013bf466a000e0d7b8256a1d978e8cf48e89ab --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/NoLineNumbers/DarkMode.golden @@ -0,0 +1,7 @@ + @@ -5,5 +5,6 @@     + )  )  +     + func main() {  func main() {  +-  fmt.Println("Hello, world!") +  content := "Hello, world!"  +  +  fmt.Println(content)  + }  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/NoLineNumbers/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/NoLineNumbers/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..241d60f8793bba0fb2819220caa6259c1124edb3 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/NoLineNumbers/LightMode.golden @@ -0,0 +1,7 @@ + @@ -5,5 +5,6 @@     + )  )  +     + func main() {  func main() {  +-  fmt.Println("Hello, world!") +  content := "Hello, world!"  +  +  fmt.Println(content)  + }  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/NoSyntaxHighlight/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/NoSyntaxHighlight/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..c69efe614a04aba3f680d6cf9af91112af13560b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/NoSyntaxHighlight/DarkMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4  "fmt"   4  "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/NoSyntaxHighlight/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/NoSyntaxHighlight/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..e22a98ecf771bc651d26af440a361286dcb167f7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/NoSyntaxHighlight/LightMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4  "fmt"   4  "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/SmallWidth/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/SmallWidth/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..c3744b0a3b97baa0404ad5830ff7893105c0db9d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/SmallWidth/DarkMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 …  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6…  …    +  9  }  10  }  + 10    11    + 11  func getConte… 12  func getConte… + 12 -  return "H… 13 +  content :… +      14 +  return co… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Split/SmallWidth/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Split/SmallWidth/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..7efec8881d7252d4e0f5a444f372a19e12e5e035 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Split/SmallWidth/LightMode.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 …  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6…  …    +  9  }  10  }  + 10    11    + 11  func getConte… 12  func getConte… + 12 -  return "H… 13 +  content :… +      14 +  return co… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/CustomContextLines/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/CustomContextLines/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..94d5b96e6ead9e58f58cead608bc24571d712d50 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/CustomContextLines/DarkMode.golden @@ -0,0 +1,17 @@ +  …   …  @@ -1,13 +1,15 @@   +  1   1  package main  +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  8   9   fmt.Println(getContent())  +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/CustomContextLines/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/CustomContextLines/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..769aef3900a021bec59a59051c537562c78c0f95 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/CustomContextLines/LightMode.golden @@ -0,0 +1,17 @@ +  …   …  @@ -1,13 +1,15 @@   +  1   1  package main  +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  8   9   fmt.Println(getContent())  +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/Default/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/Default/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..508754f0c6a3493d1efa006360eaeeacde13baea --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/Default/DarkMode.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  )  +  6   6    +  7   7  func main() {  +  8    -  fmt.Println("Hello, world!")  +     8 +  content := "Hello, world!"  +     9 +  fmt.Println(content)  +  9  10  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/Default/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/Default/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..6532d31fe0f28f9a7619af543fc10848f438f4c9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/Default/LightMode.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  )  +  6   6    +  7   7  func main() {  +  8    -  fmt.Println("Hello, world!")  +     8 +  content := "Hello, world!"  +     9 +  fmt.Println(content)  +  9  10  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/LargeWidth/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/LargeWidth/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..c0be6012af274bc1c746a26746d4e29473493ef8 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/LargeWidth/DarkMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/LargeWidth/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/LargeWidth/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..f1700f00f23dc0960a12e5cdf37281e922d8fe2d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/LargeWidth/LightMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/MultipleHunks/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/MultipleHunks/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..bd1232d8439ec0f20601793817093304b37b91c4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/MultipleHunks/DarkMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/MultipleHunks/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/MultipleHunks/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..4833a8a0263aada505f2e115c5dfb9fc469def67 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/MultipleHunks/LightMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/Narrow/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/Narrow/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..586dcd0a0ad6b4dc2963f8d2064db1e54f917b30 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/Narrow/DarkMode.golden @@ -0,0 +1,7 @@ + …  …  @@ -1,3 +1,3 @@   + 1    - a  + 2    - b  + 3    - c  +    1 + d  +    2 + e  +    3 + f  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/Narrow/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/Narrow/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..ec946344674b34b4c4530bedb1d3307ca364bc8f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/Narrow/LightMode.golden @@ -0,0 +1,7 @@ + …  …  @@ -1,3 +1,3 @@   + 1    - a  + 2    - b  + 3    - c  +    1 + d  +    2 + e  +    3 + f  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/NoLineNumbers/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/NoLineNumbers/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..23050d7964d12cbb9a4c7529d26173f5a6efd174 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/NoLineNumbers/DarkMode.golden @@ -0,0 +1,8 @@ + @@ -5,5 +5,6 @@   + )  +   + func main() {  +-  fmt.Println("Hello, world!")  ++  content := "Hello, world!"  ++  fmt.Println(content)  + }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/NoLineNumbers/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/NoLineNumbers/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..dcb98a08bb11c35eb6b1d4288ebca3e47e285948 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/NoLineNumbers/LightMode.golden @@ -0,0 +1,8 @@ + @@ -5,5 +5,6 @@   + )  +   + func main() {  +-  fmt.Println("Hello, world!")  ++  content := "Hello, world!"  ++  fmt.Println(content)  + }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/NoSyntaxHighlight/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/NoSyntaxHighlight/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..18c9c363f3952bda8537f96496405edce5684485 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/NoSyntaxHighlight/DarkMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4  "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/NoSyntaxHighlight/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/NoSyntaxHighlight/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..285caf3659ba538e0c12da796836045311ecad67 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/NoSyntaxHighlight/LightMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4  "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/SmallWidth/DarkMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/SmallWidth/DarkMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..773547de65905ab8872164be01584770da29d475 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/SmallWidth/DarkMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUppe… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffView/Unified/SmallWidth/LightMode.golden b/internal/exp/diffview/testdata/TestDiffView/Unified/SmallWidth/LightMode.golden new file mode 100644 index 0000000000000000000000000000000000000000..bc1c6c04db45d3d8dfddf23440dcfa430cec7fb0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffView/Unified/SmallWidth/LightMode.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUppe… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf001.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf001.golden new file mode 100644 index 0000000000000000000000000000000000000000..8ab230c57cafc11906a067ee7361e48b66ede3f9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf001.golden @@ -0,0 +1 @@ +  …  @@ -2,6 +2,7 @@    …    \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf002.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf002.golden new file mode 100644 index 0000000000000000000000000000000000000000..2a4e8eff92df5b3539dad4578a0715e0ec6ce42a --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf002.golden @@ -0,0 +1,2 @@ +  …  @@ -2,6 +2,7 @@    …    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf003.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf003.golden new file mode 100644 index 0000000000000000000000000000000000000000..8b77ca205d3f1c85a25f733f0a3044a541805c10 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf003.golden @@ -0,0 +1,3 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf004.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf004.golden new file mode 100644 index 0000000000000000000000000000000000000000..b42965be972ce8b096db1508514e9d494a57bad7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf004.golden @@ -0,0 +1,4 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf005.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf005.golden new file mode 100644 index 0000000000000000000000000000000000000000..8d4a293fdd17ce5cbd8d709656573105a8cc7b09 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf005.golden @@ -0,0 +1,5 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf006.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf006.golden new file mode 100644 index 0000000000000000000000000000000000000000..67d30fec443bdeea7b49eba4ab346603baba7670 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf006.golden @@ -0,0 +1,6 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf007.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf007.golden new file mode 100644 index 0000000000000000000000000000000000000000..ba19bebf9686a530e87e11d090ad4f04f4ade5fb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf007.golden @@ -0,0 +1,7 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf008.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf008.golden new file mode 100644 index 0000000000000000000000000000000000000000..edb4eb9aaa24d28523498661d3d802edb62b243d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf008.golden @@ -0,0 +1,8 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf009.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf009.golden new file mode 100644 index 0000000000000000000000000000000000000000..fc1998f1d33f0299550660b368de1e4d720c2ed0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf009.golden @@ -0,0 +1,9 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf010.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf010.golden new file mode 100644 index 0000000000000000000000000000000000000000..10474f0884137006961cc6e5bfddf6d001c5561d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf010.golden @@ -0,0 +1,10 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf011.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf011.golden new file mode 100644 index 0000000000000000000000000000000000000000..0e25a5ef5279cf29cfa1eb24831bc062a8bb6254 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf011.golden @@ -0,0 +1,11 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf012.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf012.golden new file mode 100644 index 0000000000000000000000000000000000000000..f178ad9ab9285b83c0efc9b207379a61f16ec7a9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf012.golden @@ -0,0 +1,12 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf013.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf013.golden new file mode 100644 index 0000000000000000000000000000000000000000..edcfcd2f89adef8525a8acee4d3ce9e8d1ffd605 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf013.golden @@ -0,0 +1,13 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf014.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf014.golden new file mode 100644 index 0000000000000000000000000000000000000000..6ff0ca309b149aa73bfaec8ec0debdaa253cecfe --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf014.golden @@ -0,0 +1,14 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf015.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf015.golden new file mode 100644 index 0000000000000000000000000000000000000000..376bae2594d8e175cdd84b90846fe43c639c4d69 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf015.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf016.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf016.golden new file mode 100644 index 0000000000000000000000000000000000000000..6b79b752f668a21205c772356ffb1af1d6c88546 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf016.golden @@ -0,0 +1,16 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf017.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf017.golden new file mode 100644 index 0000000000000000000000000000000000000000..81086126879f38feda13147520b4ced931441d67 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf017.golden @@ -0,0 +1,17 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf018.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf018.golden new file mode 100644 index 0000000000000000000000000000000000000000..0ced2af062c5ddfa3179501b02ea58c549491103 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf018.golden @@ -0,0 +1,18 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  +           +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf019.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf019.golden new file mode 100644 index 0000000000000000000000000000000000000000..e94c36d1f801e0dae9ae22c6758638e692aa5afa --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf019.golden @@ -0,0 +1,19 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  +           +           +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf020.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf020.golden new file mode 100644 index 0000000000000000000000000000000000000000..0c20bb81d81d8a4a000f601fa75a1f148610c06d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf020.golden @@ -0,0 +1,20 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  +           +           +           +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf001.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf001.golden new file mode 100644 index 0000000000000000000000000000000000000000..65e9cca91c8ced66ea2d69e111cb09cfbb8e8852 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf001.golden @@ -0,0 +1 @@ +  …   …  @@ -2,6 +2,7 @@   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf002.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf002.golden new file mode 100644 index 0000000000000000000000000000000000000000..61a03f25c81520058f8fd3856a03e84daac6cbb6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf002.golden @@ -0,0 +1,2 @@ +  …   …  @@ -2,6 +2,7 @@   +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf003.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf003.golden new file mode 100644 index 0000000000000000000000000000000000000000..6951d63de62756d581aa7a98564d6547dd244609 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf003.golden @@ -0,0 +1,3 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf004.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf004.golden new file mode 100644 index 0000000000000000000000000000000000000000..c25c0f42f2fce40ac113946407cfee70cb597ebd --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf004.golden @@ -0,0 +1,4 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf005.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf005.golden new file mode 100644 index 0000000000000000000000000000000000000000..e11e6df667cfa9dc3d909f30fef8895c16dc85c2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf005.golden @@ -0,0 +1,5 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf006.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf006.golden new file mode 100644 index 0000000000000000000000000000000000000000..d6a7952a8e59e13f6443a7430a08d38245963daa --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf006.golden @@ -0,0 +1,6 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf007.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf007.golden new file mode 100644 index 0000000000000000000000000000000000000000..f04437d8e721cd83ccac5d83d7ece23aea2deca9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf007.golden @@ -0,0 +1,7 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf008.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf008.golden new file mode 100644 index 0000000000000000000000000000000000000000..9bc97685b06c45886e3e51aa853e6979c13535f4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf008.golden @@ -0,0 +1,8 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf009.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf009.golden new file mode 100644 index 0000000000000000000000000000000000000000..b644669ac3c44b02fa524df27a79ca5fa43ebc5f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf009.golden @@ -0,0 +1,9 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf010.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf010.golden new file mode 100644 index 0000000000000000000000000000000000000000..2c1730435a32cf3a5adfa6a0cd2b7096959d72cb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf010.golden @@ -0,0 +1,10 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf011.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf011.golden new file mode 100644 index 0000000000000000000000000000000000000000..11933267d0e96a9d40847cc6ab63eb8a638c903f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf011.golden @@ -0,0 +1,11 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf012.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf012.golden new file mode 100644 index 0000000000000000000000000000000000000000..6f85a1321dafe076664f68bce0cfacc904bcf348 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf012.golden @@ -0,0 +1,12 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf013.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf013.golden new file mode 100644 index 0000000000000000000000000000000000000000..9a40f2743bb130da78160e44804121046bfc2648 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf013.golden @@ -0,0 +1,13 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf014.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf014.golden new file mode 100644 index 0000000000000000000000000000000000000000..92c873c53589db4d5dbb3d5823577ec0ea3c0525 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf014.golden @@ -0,0 +1,14 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf015.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf015.golden new file mode 100644 index 0000000000000000000000000000000000000000..a6c452786f6dd1a90b06af9565230a32a2f7fca9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf015.golden @@ -0,0 +1,15 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf016.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf016.golden new file mode 100644 index 0000000000000000000000000000000000000000..4833a8a0263aada505f2e115c5dfb9fc469def67 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf016.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf017.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf017.golden new file mode 100644 index 0000000000000000000000000000000000000000..6a11e8c96fbf5917fb8fba209c6e08420042b50e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf017.golden @@ -0,0 +1,17 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf018.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf018.golden new file mode 100644 index 0000000000000000000000000000000000000000..e1679a274299677d72b8fde8f12f8900edb32244 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf018.golden @@ -0,0 +1,18 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  +         +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf019.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf019.golden new file mode 100644 index 0000000000000000000000000000000000000000..e500ceed976da0ee572e015eba1e1908963ce0f2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf019.golden @@ -0,0 +1,19 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  +         +         +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf020.golden b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf020.golden new file mode 100644 index 0000000000000000000000000000000000000000..89d701a43e2df3c14677ef4135dfebc7654eb3df --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf020.golden @@ -0,0 +1,20 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  +         +         +         +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewTabs/Split.golden b/internal/exp/diffview/testdata/TestDiffViewTabs/Split.golden new file mode 100644 index 0000000000000000000000000000000000000000..55f9b83eb60b7d807d6573770c095f1fe4300380 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewTabs/Split.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewTabs/Unified.golden b/internal/exp/diffview/testdata/TestDiffViewTabs/Unified.golden new file mode 100644 index 0000000000000000000000000000000000000000..744ba1f8400a69344016826ad10de5a72c540a0b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewTabs/Unified.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf001.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf001.golden new file mode 100644 index 0000000000000000000000000000000000000000..3fc43d9cabb64c1de963ffc5fb229bb6a853690e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf001.golden @@ -0,0 +1,15 @@ +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf002.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf002.golden new file mode 100644 index 0000000000000000000000000000000000000000..e9ff4178d144232d7c64aa08f98235174ae6171a --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf002.golden @@ -0,0 +1,15 @@ +   +   +   +   +   +   +   +   +   +   + 1 + 1 + 1 +   + 1 \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf003.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf003.golden new file mode 100644 index 0000000000000000000000000000000000000000..e4793972aaef14ebd0efdd95899a412b7afd88fe --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf003.golden @@ -0,0 +1,15 @@ +  … +  2 +  3 +  4 +   +  5 +  6 +  7 +  … +  9 + 10 + 11 + 12 +   + 13 \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf004.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf004.golden new file mode 100644 index 0000000000000000000000000000000000000000..ea92f5ceffc1e6c99381064d731ac9321f09ce3e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf004.golden @@ -0,0 +1,15 @@ +  …  +  2  +  3  +  4  +    +  5  +  6  +  7  +  …  +  9  + 10  + 11  + 12  +    + 13  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf005.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf005.golden new file mode 100644 index 0000000000000000000000000000000000000000..52d7f5f1a76707802fbc4426c0004f5c618cf887 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf005.golden @@ -0,0 +1,15 @@ +  …   +  2   +  3   +  4   +     +  5   +  6   +  7   +  …   +  9   + 10   + 11   + 12 - +     + 13   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf006.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf006.golden new file mode 100644 index 0000000000000000000000000000000000000000..7d4c531980e2af3a94cd612e2fcb5bb672ceb553 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf006.golden @@ -0,0 +1,15 @@ +  …    +  2   +  3   +  4   +     +  5   +  6   +  7   +  …    +  9   + 10   + 11   + 12 -  +     + 13   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf007.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf007.golden new file mode 100644 index 0000000000000000000000000000000000000000..5d837eeb27466b95efdb8fd65f9a39ca9d27e3f4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf007.golden @@ -0,0 +1,15 @@ +  …   … +  2    +  3    +  4    +      +  5    +  6    +  7    +  …   … +  9    + 10    + 11    + 12 -   +      + 13    \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf008.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf008.golden new file mode 100644 index 0000000000000000000000000000000000000000..1a34fe59526ac61809752750759bfd894c9fdbb7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf008.golden @@ -0,0 +1,15 @@ +  …   …  +  2     +  3     +  4     +       +  5     +  6     +  7     +  …   …  +  9   1 + 10   1 + 11   1 + 12 -  1 +     1 + 13   1 \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf009.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf009.golden new file mode 100644 index 0000000000000000000000000000000000000000..47170f9836acbbe16f1de1fc739b1a9e32924ebf --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf009.golden @@ -0,0 +1,15 @@ +  … …  …  +  2    2  +  3    3  +  4    4  +      5  +  5    6  +  6    7  +  7    8  +  … …  …  +  9   10  + 10   11  + 11   12  + 12 - 13  +     14  + 13   15  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf010.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf010.golden new file mode 100644 index 0000000000000000000000000000000000000000..7de1ab70c01b038036944c1be33703eaa3ee69e2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf010.golden @@ -0,0 +1,15 @@ +  … …  …   +  2    2   +  3    3   +  4    4   +      5 + +  5    6   +  6    7   +  7    8   +  … …  …   +  9   10   + 10   11   + 11   12   + 12 - 13 + +     14 + + 13   15   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf011.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf011.golden new file mode 100644 index 0000000000000000000000000000000000000000..0a3c87cd5b70374bb983c3bbb131e38691d6f857 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf011.golden @@ -0,0 +1,15 @@ +  …  …  …   +  2    2   +  3    3   +  4    4   +      5 + +  5    6   +  6    7   +  7    8   +  …  …  …   +  9   10   + 10   11   + 11   12   + 12 -  13 + +     14 + + 13   15   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf012.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf012.golden new file mode 100644 index 0000000000000000000000000000000000000000..70e872896752b131d9c42289a062f2ac7b0069cb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf012.golden @@ -0,0 +1,15 @@ +  …  …  …    +  2    2   +  3    3   +  4    4   +      5 +  +  5    6   +  6    7   +  7    8   +  …  …  …    +  9   10   + 10   11   + 11   12   + 12 -  13 +  +     14 +  + 13   15   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf013.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf013.golden new file mode 100644 index 0000000000000000000000000000000000000000..18784d5152179f7166a928d253b00515ff549dcf --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf013.golden @@ -0,0 +1,15 @@ +  …  …  …    +  2    2    +  3    3    +  4    4    +      5 +   +  5    6    +  6    7    +  7    8    +  …  …  …    +  9   10    + 10   11    + 11   12    + 12 -  13 +   +     14 +   + 13   15    \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf014.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf014.golden new file mode 100644 index 0000000000000000000000000000000000000000..92962575466205b1520bcb948bfbcf3d9040cd20 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf014.golden @@ -0,0 +1,15 @@ +  …  …  …    +  2     2    +  3  …  3  … +  4  …  4  … +       5 + … +  5  )  6  ) +  6     7    +  7  …  8  … +  …  …  …    +  9  } 10  } + 10    11    + 11  … 12  … + 12 - … 13 + … +      14 + … + 13  } 15  } \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf015.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf015.golden new file mode 100644 index 0000000000000000000000000000000000000000..3e564c4e1b4224f1c1a95c4e459b14b989ed9211 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf015.golden @@ -0,0 +1,15 @@ +  …  …  …    +  2     2    +  3  …  3  …  +  4  …  4  …  +       5 + …  +  5  )  6  )  +  6     7    +  7  …  8  …  +  …  …  …    +  9  } 10  }  + 10    11    + 11  … 12  …  + 12 - … 13 + …  +      14 + …  + 13  } 15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf016.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf016.golden new file mode 100644 index 0000000000000000000000000000000000000000..73c32b5beb4fe882fee590f933ba30fc7df3f055 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf016.golden @@ -0,0 +1,15 @@ +  …  @…  …    +  2     2    +  3  i…  3  i… +  4   …  4   … +       5 +  … +  5  )   6  )  +  6     7    +  7  f…  8  f… +  …  @…  …    +  9  }  10  }  + 10    11    + 11  f… 12  f… + 12 -  … 13 +  … +      14 +  … + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf017.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf017.golden new file mode 100644 index 0000000000000000000000000000000000000000..a0a56d1c19961775f7ae0b8471f2dd36be2898d6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf017.golden @@ -0,0 +1,15 @@ +  …  @…  …    +  2     2    +  3  i…  3  i…  +  4   …  4   …  +       5 +  …  +  5  )   6  )  +  6     7    +  7  f…  8  f…  +  …  @…  …    +  9  }  10  }  + 10    11    + 11  f… 12  f…  + 12 -  … 13 +  …  +      14 +  …  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf018.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf018.golden new file mode 100644 index 0000000000000000000000000000000000000000..eaf9ba5140a00fbb67c689bf66cae5293464fbbd --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf018.golden @@ -0,0 +1,15 @@ +  …  @@…  …    +  2     2    +  3  im…  3  im… +  4   …  4   … +       5 +  … +  5  )   6  )  +  6     7    +  7  fu…  8  fu… +  …  @@…  …    +  9  }  10  }  + 10    11    + 11  fu… 12  fu… + 12 -  … 13 +  … +      14 +  … + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf019.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf019.golden new file mode 100644 index 0000000000000000000000000000000000000000..f2b48119efe04ce3650d2964df314d7a43fadd99 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf019.golden @@ -0,0 +1,15 @@ +  …  @@…  …    +  2     2    +  3  im…  3  im…  +  4   …  4   …  +       5 +  …  +  5  )   6  )  +  6     7    +  7  fu…  8  fu…  +  …  @@…  …    +  9  }  10  }  + 10    11    + 11  fu… 12  fu…  + 12 -  … 13 +  …  +      14 +  …  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf020.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf020.golden new file mode 100644 index 0000000000000000000000000000000000000000..80faca00e90d24c17339877a2e96fee8363d195b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf020.golden @@ -0,0 +1,15 @@ +  …  @@ …  …    +  2     2    +  3  imp…  3  imp… +  4   …  4   … +       5 +  … +  5  )   6  )  +  6     7    +  7  fun…  8  fun… +  …  @@ …  …    +  9  }  10  }  + 10    11    + 11  fun… 12  fun… + 12 -  … 13 +  … +      14 +  … + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf021.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf021.golden new file mode 100644 index 0000000000000000000000000000000000000000..ef6bbfffd814eb2ae28e1f399d78ebe9ea1c3b05 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf021.golden @@ -0,0 +1,15 @@ +  …  @@ …  …    +  2     2    +  3  imp…  3  imp…  +  4   …  4   …  +       5 +  …  +  5  )   6  )  +  6     7    +  7  fun…  8  fun…  +  …  @@ …  …    +  9  }  10  }  + 10    11    + 11  fun… 12  fun…  + 12 -  … 13 +  …  +      14 +  …  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf022.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf022.golden new file mode 100644 index 0000000000000000000000000000000000000000..9a3d74e5073f9229d4ff87cf0f54cc035804a87e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf022.golden @@ -0,0 +1,15 @@ +  …  @@ -…  …    +  2     2    +  3  impo…  3  impo… +  4   …  4   … +       5 +  … +  5  )   6  )  +  6     7    +  7  func…  8  func… +  …  @@ -…  …    +  9  }  10  }  + 10    11    + 11  func… 12  func… + 12 -  … 13 +  … +      14 +  … + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf023.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf023.golden new file mode 100644 index 0000000000000000000000000000000000000000..8b59e07438c73077b25e91e1aea95b0762278ead --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf023.golden @@ -0,0 +1,15 @@ +  …  @@ -…  …    +  2     2    +  3  impo…  3  impo…  +  4   …  4   …  +       5 +  …  +  5  )   6  )  +  6     7    +  7  func…  8  func…  +  …  @@ -…  …    +  9  }  10  }  + 10    11    + 11  func… 12  func…  + 12 -  … 13 +  …  +      14 +  …  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf024.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf024.golden new file mode 100644 index 0000000000000000000000000000000000000000..e9e963f6d68f39797652735946bba4d60f9bb07b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf024.golden @@ -0,0 +1,15 @@ +  …  @@ -2…  …    +  2     2    +  3  impor…  3  impor… +  4   "…  4   "… +       5 +  "… +  5  )   6  )  +  6     7    +  7  func …  8  func … +  …  @@ -9…  …    +  9  }  10  }  + 10    11    + 11  func … 12  func … + 12 -  r… 13 +  c… +      14 +  r… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf025.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf025.golden new file mode 100644 index 0000000000000000000000000000000000000000..88b14c368e9d758f73b170aedcc289665b323de5 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf025.golden @@ -0,0 +1,15 @@ +  …  @@ -2…  …    +  2     2    +  3  impor…  3  impor…  +  4   "…  4   "…  +       5 +  "…  +  5  )   6  )  +  6     7    +  7  func …  8  func …  +  …  @@ -9…  …    +  9  }  10  }  + 10    11    + 11  func … 12  func …  + 12 -  r… 13 +  c…  +      14 +  r…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf026.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf026.golden new file mode 100644 index 0000000000000000000000000000000000000000..f1a03a44b153d125baea902647542eb268e04c85 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf026.golden @@ -0,0 +1,15 @@ +  …  @@ -2,…  …    +  2     2    +  3  import…  3  import… +  4   "f…  4   "f… +       5 +  "s… +  5  )   6  )  +  6     7    +  7  func m…  8  func m… +  …  @@ -9,…  …    +  9  }  10  }  + 10    11    + 11  func g… 12  func g… + 12 -  re… 13 +  co… +      14 +  re… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf027.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf027.golden new file mode 100644 index 0000000000000000000000000000000000000000..2be2ed4039296a08ca88ea742294c69fe328bb09 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf027.golden @@ -0,0 +1,15 @@ +  …  @@ -2,…  …    +  2     2    +  3  import…  3  import…  +  4   "f…  4   "f…  +       5 +  "s…  +  5  )   6  )  +  6     7    +  7  func m…  8  func m…  +  …  @@ -9,…  …    +  9  }  10  }  + 10    11    + 11  func g… 12  func g…  + 12 -  re… 13 +  co…  +      14 +  re…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf028.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf028.golden new file mode 100644 index 0000000000000000000000000000000000000000..ac729f74b19b2bed7b6c254aae945d6dcd9321af --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf028.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6…  …    +  2     2    +  3  import (  3  import ( +  4   "fm…  4   "fm… +       5 +  "st… +  5  )   6  )  +  6     7    +  7  func ma…  8  func ma… +  …  @@ -9,5…  …    +  9  }  10  }  + 10    11    + 11  func ge… 12  func ge… + 12 -  ret… 13 +  con… +      14 +  ret… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf029.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf029.golden new file mode 100644 index 0000000000000000000000000000000000000000..ac330346bcde118e8f0366cd3bf5ba85162a7156 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf029.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6…  …    +  2     2    +  3  import (  3  import (  +  4   "fm…  4   "fm…  +       5 +  "st…  +  5  )   6  )  +  6     7    +  7  func ma…  8  func ma…  +  …  @@ -9,5…  …    +  9  }  10  }  + 10    11    + 11  func ge… 12  func ge…  + 12 -  ret… 13 +  con…  +      14 +  ret…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf030.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf030.golden new file mode 100644 index 0000000000000000000000000000000000000000..6504f7ece94be17d44840ce265658a01165f6764 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf030.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 …  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"  4   "fmt" +       5 +  "str… +  5  )   6  )  +  6     7    +  7  func mai…  8  func mai… +  …  @@ -9,5 …  …    +  9  }  10  }  + 10    11    + 11  func get… 12  func get… + 12 -  retu… 13 +  cont… +      14 +  retu… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf031.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf031.golden new file mode 100644 index 0000000000000000000000000000000000000000..8c93b028a434f0819fa013886eb00d8aabd1285d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf031.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 …  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"  4   "fmt"  +       5 +  "str…  +  5  )   6  )  +  6     7    +  7  func mai…  8  func mai…  +  …  @@ -9,5 …  …    +  9  }  10  }  + 10    11    + 11  func get… 12  func get…  + 12 -  retu… 13 +  cont…  +      14 +  retu…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf032.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf032.golden new file mode 100644 index 0000000000000000000000000000000000000000..4a71409e9b273fbe3095c77ae6b14817e1d4a712 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf032.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "stri… +  5  )   6  )  +  6     7    +  7  func main…  8  func main… +  …  @@ -9,5 +…  …    +  9  }  10  }  + 10    11    + 11  func getC… 12  func getC… + 12 -  retur… 13 +  conte… +      14 +  retur… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf033.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf033.golden new file mode 100644 index 0000000000000000000000000000000000000000..9273c0133a6bb74a1d9ff0786ec5b8d001cf1eb6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf033.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "stri…  +  5  )   6  )  +  6     7    +  7  func main…  8  func main…  +  …  @@ -9,5 +…  …    +  9  }  10  }  + 10    11    + 11  func getC… 12  func getC…  + 12 -  retur… 13 +  conte…  +      14 +  retur…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf034.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf034.golden new file mode 100644 index 0000000000000000000000000000000000000000..bafd04e96979aba50254250e9260e9079606bd6c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf034.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strin… +  5  )   6  )  +  6     7    +  7  func main(…  8  func main(… +  …  @@ -9,5 +1…  …    +  9  }  10  }  + 10    11    + 11  func getCo… 12  func getCo… + 12 -  return… 13 +  conten… +      14 +  return… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf035.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf035.golden new file mode 100644 index 0000000000000000000000000000000000000000..8ac20fa259d92f9c4a13c1b7d0b3ece1ef65639c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf035.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strin…  +  5  )   6  )  +  6     7    +  7  func main(…  8  func main(…  +  …  @@ -9,5 +1…  …    +  9  }  10  }  + 10    11    + 11  func getCo… 12  func getCo…  + 12 -  return… 13 +  conten…  +      14 +  return…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf036.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf036.golden new file mode 100644 index 0000000000000000000000000000000000000000..a138a46233c89e3526ceb96c1c672aadd7daa919 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf036.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "string… +  5  )   6  )  +  6     7    +  7  func main()…  8  func main()… +  …  @@ -9,5 +10…  …    +  9  }  10  }  + 10    11    + 11  func getCon… 12  func getCon… + 12 -  return … 13 +  content… +      14 +  return … + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf037.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf037.golden new file mode 100644 index 0000000000000000000000000000000000000000..dd0cb8c2799baa35864ca202dd67a97b5434b8bc --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf037.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "string…  +  5  )   6  )  +  6     7    +  7  func main()…  8  func main()…  +  …  @@ -9,5 +10…  …    +  9  }  10  }  + 10    11    + 11  func getCon… 12  func getCon…  + 12 -  return … 13 +  content…  +      14 +  return …  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf038.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf038.golden new file mode 100644 index 0000000000000000000000000000000000000000..b0084aa014a51992926f11b26cef01b4fc21ab12 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf038.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings" +  5  )   6  )  +  6     7    +  7  func main() {  8  func main() { +  …  @@ -9,5 +10,…  …    +  9  }  10  }  + 10    11    + 11  func getCont… 12  func getCont… + 12 -  return "… 13 +  content … +      14 +  return c… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf039.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf039.golden new file mode 100644 index 0000000000000000000000000000000000000000..ae1bde4711283fe156a8a349f6499c030e3daa66 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf039.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {  8  func main() {  +  …  @@ -9,5 +10,…  …    +  9  }  10  }  + 10    11    + 11  func getCont… 12  func getCont…  + 12 -  return "… 13 +  content …  +      14 +  return c…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf040.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf040.golden new file mode 100644 index 0000000000000000000000000000000000000000..7efec8881d7252d4e0f5a444f372a19e12e5e035 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf040.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 …  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6…  …    +  9  }  10  }  + 10    11    + 11  func getConte… 12  func getConte… + 12 -  return "H… 13 +  content :… +      14 +  return co… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf041.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf041.golden new file mode 100644 index 0000000000000000000000000000000000000000..10c4f687102fb8aed1d0456cde43a67ebf2a06d3 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf041.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 …  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6…  …    +  9  }  10  }  + 10    11    + 11  func getConte… 12  func getConte…  + 12 -  return "H… 13 +  content :…  +      14 +  return co…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf042.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf042.golden new file mode 100644 index 0000000000000000000000000000000000000000..9af1da8df7623454ca6d493baa5c1e248c988c8c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf042.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 …  …    +  9  }  10  }  + 10    11    + 11  func getConten… 12  func getConten… + 12 -  return "He… 13 +  content :=… +      14 +  return con… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf043.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf043.golden new file mode 100644 index 0000000000000000000000000000000000000000..d4a9545f90cba3e7004f989b4b3231b921119b57 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf043.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @…  …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 …  …    +  9  }  10  }  + 10    11    + 11  func getConten… 12  func getConten…  + 12 -  return "He… 13 +  content :=…  +      14 +  return con…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf044.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf044.golden new file mode 100644 index 0000000000000000000000000000000000000000..31b3e5b8a566adde3453c3681ecfbd14721ea8d3 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf044.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@   …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @…  …    +  9  }  10  }  + 10    11    + 11  func getContent… 12  func getContent… + 12 -  return "Hel… 13 +  content := … +      14 +  return cont… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf045.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf045.golden new file mode 100644 index 0000000000000000000000000000000000000000..715b72802b8c564615318eec9afc966e4913ec4c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf045.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@   …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @…  …    +  9  }  10  }  + 10    11    + 11  func getContent… 12  func getContent…  + 12 -  return "Hel… 13 +  content := …  +      14 +  return cont…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf046.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf046.golden new file mode 100644 index 0000000000000000000000000000000000000000..8f750e45dde66d7378ebd1c3cac9dcc42fd35928 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf046.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@   …    +  9  }  10  }  + 10    11    + 11  func getContent(… 12  func getContent(… + 12 -  return "Hell… 13 +  content := s… +      14 +  return conte… + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf047.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf047.golden new file mode 100644 index 0000000000000000000000000000000000000000..88d0334c820b4178059342fa2e1da9abc31554a7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf047.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@   …    +  9  }  10  }  + 10    11    + 11  func getContent(… 12  func getContent(…  + 12 -  return "Hell… 13 +  content := s…  +      14 +  return conte…  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf048.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf048.golden new file mode 100644 index 0000000000000000000000000000000000000000..7f61027cd84e09baa6fbb032373a17dd2604e793 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf048.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent()… 12  func getContent()… + 12 -  return "Hello… 13 +  content := st… +      14 +  return content + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf049.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf049.golden new file mode 100644 index 0000000000000000000000000000000000000000..9bb7c27c780a323330ce8809d49ca3a530e3446c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf049.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent()… 12  func getContent()…  + 12 -  return "Hello… 13 +  content := st…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf050.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf050.golden new file mode 100644 index 0000000000000000000000000000000000000000..ce5e92957c386876a86cb4560a4eadf8a7e08dc7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf050.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() … 12  func getContent() … + 12 -  return "Hello,… 13 +  content := str… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf051.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf051.golden new file mode 100644 index 0000000000000000000000000000000000000000..82adeb499fc4b5b6d15f9553765f3d1b4d1979dc --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf051.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() … 12  func getContent() …  + 12 -  return "Hello,… 13 +  content := str…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf052.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf052.golden new file mode 100644 index 0000000000000000000000000000000000000000..ae6953eb26ea0aaeddb450b4da018c5cdc3797d0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf052.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() s… 12  func getContent() s… + 12 -  return "Hello, … 13 +  content := stri… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf053.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf053.golden new file mode 100644 index 0000000000000000000000000000000000000000..51a38de9c1ef157ddf956975a705bd8c99927d91 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf053.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() s… 12  func getContent() s…  + 12 -  return "Hello, … 13 +  content := stri…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf054.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf054.golden new file mode 100644 index 0000000000000000000000000000000000000000..24c8e4d4b1fb74c8c2ab1e52127bc7dfdef8cde0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf054.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() st… 12  func getContent() st… + 12 -  return "Hello, w… 13 +  content := strin… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf055.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf055.golden new file mode 100644 index 0000000000000000000000000000000000000000..cc0efd45a2cd5aa42b0734988df64ea2d05f880c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf055.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() st… 12  func getContent() st…  + 12 -  return "Hello, w… 13 +  content := strin…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf056.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf056.golden new file mode 100644 index 0000000000000000000000000000000000000000..4de6f41ffaf0e87c4eda3263b57f42d84fc38aea --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf056.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() str… 12  func getContent() str… + 12 -  return "Hello, wo… 13 +  content := string… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf057.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf057.golden new file mode 100644 index 0000000000000000000000000000000000000000..77419b66cf6caa014ddcb5324c3d8fe08b0fbdda --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf057.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() str… 12  func getContent() str…  + 12 -  return "Hello, wo… 13 +  content := string…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf058.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf058.golden new file mode 100644 index 0000000000000000000000000000000000000000..5992c78e7352a1d59605deaa364ff8b3e6262bf9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf058.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() stri… 12  func getContent() stri… + 12 -  return "Hello, wor… 13 +  content := strings… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf059.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf059.golden new file mode 100644 index 0000000000000000000000000000000000000000..544a55196beb09c4784f668be8326bd5edb7e34e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf059.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() stri… 12  func getContent() stri…  + 12 -  return "Hello, wor… 13 +  content := strings…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf060.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf060.golden new file mode 100644 index 0000000000000000000000000000000000000000..be01c935ada5686d689419f32873e280ac87b819 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf060.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() strin… 12  func getContent() strin… + 12 -  return "Hello, worl… 13 +  content := strings.… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf061.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf061.golden new file mode 100644 index 0000000000000000000000000000000000000000..c7b19c70c3cf547cfd8d8468426a767c3f1bc8eb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf061.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() strin… 12  func getContent() strin…  + 12 -  return "Hello, worl… 13 +  content := strings.…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf062.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf062.golden new file mode 100644 index 0000000000000000000000000000000000000000..8cf7d33c9dc489bfac63f416d78f90e8c9b240ee --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf062.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string… 12  func getContent() string… + 12 -  return "Hello, world… 13 +  content := strings.T… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf063.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf063.golden new file mode 100644 index 0000000000000000000000000000000000000000..ed1e489534d52ccb007df6102fcdd6955eacbe11 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf063.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string… 12  func getContent() string…  + 12 -  return "Hello, world… 13 +  content := strings.T…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf064.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf064.golden new file mode 100644 index 0000000000000000000000000000000000000000..264b2f157f302c9efe51aa19fdf6652b21966357 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf064.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string { 12  func getContent() string { + 12 -  return "Hello, world!" 13 +  content := strings.To… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf065.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf065.golden new file mode 100644 index 0000000000000000000000000000000000000000..769077f8ddd3f8945e593a7dc829e32d0fc2a0da --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf065.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string { 12  func getContent() string {  + 12 -  return "Hello, world!" 13 +  content := strings.To…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf066.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf066.golden new file mode 100644 index 0000000000000000000000000000000000000000..41175031e8f238872ba86604bed92cc3852ee38f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf066.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToU… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf067.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf067.golden new file mode 100644 index 0000000000000000000000000000000000000000..f6988276acd56bd73a1e4f5ae3896c423a6d2b06 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf067.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToU…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf068.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf068.golden new file mode 100644 index 0000000000000000000000000000000000000000..fc6241eae81aa7d386813dc04432d47876ce0fd7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf068.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUp… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf069.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf069.golden new file mode 100644 index 0000000000000000000000000000000000000000..7d9ec994c9e1e13c40f954879feb1a5d1f600439 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf069.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUp…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf070.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf070.golden new file mode 100644 index 0000000000000000000000000000000000000000..2083a6eae970030b41a3cd0b941863927c55a185 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf070.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpp… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf071.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf071.golden new file mode 100644 index 0000000000000000000000000000000000000000..760cdb047ee5ac89224e2c48b663bb09ae577433 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf071.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpp…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf072.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf072.golden new file mode 100644 index 0000000000000000000000000000000000000000..b38d7f6d21bd1f4f4e8f1929bb0d0c12f509e184 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf072.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUppe… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf073.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf073.golden new file mode 100644 index 0000000000000000000000000000000000000000..46afcacf662110f5f75a26556e554bd871df6d45 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf073.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUppe…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf074.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf074.golden new file mode 100644 index 0000000000000000000000000000000000000000..414b8830390e69f43c724734053a31a2461b0d41 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf074.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf075.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf075.golden new file mode 100644 index 0000000000000000000000000000000000000000..e64acc77814513ff1650e77ddab0e195cb2b2cdc --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf075.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf076.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf076.golden new file mode 100644 index 0000000000000000000000000000000000000000..d2b86deb4a1113f6313c40caf31837d4900c64eb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf076.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper(… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf077.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf077.golden new file mode 100644 index 0000000000000000000000000000000000000000..b22b38baab4104282cf5dc1d7a49d0882c883fdd --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf077.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper(…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf078.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf078.golden new file mode 100644 index 0000000000000000000000000000000000000000..12827013422b14ab15f0d124a65588c5ab1a47dc --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf078.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf079.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf079.golden new file mode 100644 index 0000000000000000000000000000000000000000..2d50d36a9bd2b63bec0e0b463dccb5a0b7ebfd8d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf079.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf080.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf080.golden new file mode 100644 index 0000000000000000000000000000000000000000..dcfc005d89889ca3216f1d13d578332f24519b88 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf080.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("H… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf081.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf081.golden new file mode 100644 index 0000000000000000000000000000000000000000..a8ba35922b863854e348ee949bca17304598158f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf081.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("H…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf082.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf082.golden new file mode 100644 index 0000000000000000000000000000000000000000..7160250698adaad0fb9fdf21e6602866577c2e95 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf082.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("He… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf083.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf083.golden new file mode 100644 index 0000000000000000000000000000000000000000..2aa2d2d1e9cd296520d4c0a0362586d221ea5547 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf083.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("He…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf084.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf084.golden new file mode 100644 index 0000000000000000000000000000000000000000..365fa7567ae83238ef14c9853b6019f8d9d76a81 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf084.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hel… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf085.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf085.golden new file mode 100644 index 0000000000000000000000000000000000000000..591f662b6b13b1a93be2394e776aa663585659b2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf085.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hel…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf086.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf086.golden new file mode 100644 index 0000000000000000000000000000000000000000..4cbe0d54aae59078129851e100b6228f678b00d0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf086.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hell… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf087.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf087.golden new file mode 100644 index 0000000000000000000000000000000000000000..b03ee8eadedfda27d6989fa531603bac3b653f59 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf087.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hell…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf088.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf088.golden new file mode 100644 index 0000000000000000000000000000000000000000..dad8e4a09a350c3085942ab29c31fb0476129a76 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf088.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf089.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf089.golden new file mode 100644 index 0000000000000000000000000000000000000000..361ce9c4119c1ec870b3f16775dc9ca5fc28bc71 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf089.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf090.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf090.golden new file mode 100644 index 0000000000000000000000000000000000000000..ac5688381c2a73dd8e83189f88ce1464ba55362d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf090.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6[m  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello,… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf091.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf091.golden new file mode 100644 index 0000000000000000000000000000000000000000..9335a76abd6d37a2dc52c20bf38f1e3470455ebe --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf091.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello,…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf092.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf092.golden new file mode 100644 index 0000000000000000000000000000000000000000..a089778adc04f6ae5ebc54c0576babaae46c2579 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf092.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, … +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf093.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf093.golden new file mode 100644 index 0000000000000000000000000000000000000000..d74e0e4dfd8964ad1dbce8d4b6bab2629999939b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf093.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, …  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf094.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf094.golden new file mode 100644 index 0000000000000000000000000000000000000000..159da99b8898d95891669209ebe5369e52d105de --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf094.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, W… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf095.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf095.golden new file mode 100644 index 0000000000000000000000000000000000000000..7bf03eaa9224a70e982ddce0073d9f36f04ae547 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf095.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, W…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf096.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf096.golden new file mode 100644 index 0000000000000000000000000000000000000000..e3135d8681efc69853b2381184d4f7b8a16e8b32 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf096.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, Wo… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf097.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf097.golden new file mode 100644 index 0000000000000000000000000000000000000000..de2c0c5aa41e04c385374e75a2a0f0255faaefce --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf097.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, Wo…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf098.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf098.golden new file mode 100644 index 0000000000000000000000000000000000000000..56052a977fce039b57aeee0d0ec402a1d1a04bed --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf098.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, Wor… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf099.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf099.golden new file mode 100644 index 0000000000000000000000000000000000000000..f61adea5d8c82ff47df19349face74487f1257ce --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf099.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, Wor…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf100.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf100.golden new file mode 100644 index 0000000000000000000000000000000000000000..58be05012e0b61d77d34126e7741d50cbbd41277 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf100.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, Worl… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf101.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf101.golden new file mode 100644 index 0000000000000000000000000000000000000000..a1f145e36a97eae035efea876b85d32b3fc390ff --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf101.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, Worl…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf102.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf102.golden new file mode 100644 index 0000000000000000000000000000000000000000..6fd5678e6859b1fe5e54afb1b54dbc894b0595d4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf102.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf103.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf103.golden new file mode 100644 index 0000000000000000000000000000000000000000..58d22841956cfae75a87aaeed04eb8b3dd7ca586 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf103.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf104.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf104.golden new file mode 100644 index 0000000000000000000000000000000000000000..31c3e8981d90b33b7eb45e9c8b1bddf6cc36efca --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf104.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!… +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf105.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf105.golden new file mode 100644 index 0000000000000000000000000000000000000000..25254c9b09f9e582887c8bc738de4d1e30ef260c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf105.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!…  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf106.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf106.golden new file mode 100644 index 0000000000000000000000000000000000000000..5546a1538824cf03333077aa3b8bcc02f30d5f14 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf106.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!") +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf107.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf107.golden new file mode 100644 index 0000000000000000000000000000000000000000..fcee0eac1c1e60e4bfa27522ede8c7fe0ca9a49e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf107.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf108.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf108.golden new file mode 100644 index 0000000000000000000000000000000000000000..376bae2594d8e175cdd84b90846fe43c639c4d69 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf108.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf109.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf109.golden new file mode 100644 index 0000000000000000000000000000000000000000..95d673f67bfd11f2bf5f56b6cc33960160f4be1f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf109.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf110.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf110.golden new file mode 100644 index 0000000000000000000000000000000000000000..12fb2103fda145ee2c326171ba74ede6b8500a69 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Split/WidthOf110.golden @@ -0,0 +1,15 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf001.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf001.golden new file mode 100644 index 0000000000000000000000000000000000000000..f5ae08f760e597d50e72dcb4c99fe13136fcad89 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf001.golden @@ -0,0 +1,16 @@ +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf002.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf002.golden new file mode 100644 index 0000000000000000000000000000000000000000..905f4640bb21bb8c092c0ca5fcab313591cb1796 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf002.golden @@ -0,0 +1,16 @@ +   +   +   +   +   +   +   +   +   +   + 1 + 1 + 1 +   +   + 1 \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf003.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf003.golden new file mode 100644 index 0000000000000000000000000000000000000000..c9e63d8c4abc76931039144b413cb824f8ff9bb2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf003.golden @@ -0,0 +1,16 @@ +  … +  2 +  3 +  4 +   +  5 +  6 +  7 +  … +  9 + 10 + 11 + 12 +   +   + 13 \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf004.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf004.golden new file mode 100644 index 0000000000000000000000000000000000000000..7cdf60705770462ea57c0f4c1a1e0fe58ae167eb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf004.golden @@ -0,0 +1,16 @@ +  …  +  2  +  3  +  4  +    +  5  +  6  +  7  +  …  +  9  + 10  + 11  + 12  +    +    + 13  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf005.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf005.golden new file mode 100644 index 0000000000000000000000000000000000000000..092ad8837b7435ac3870ec87a0ddbdaceb48282c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf005.golden @@ -0,0 +1,16 @@ +  …   +  2   +  3   +  4   +     +  5   +  6   +  7   +  …   +  9   + 10   + 11   + 12   +     +     + 13   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf006.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf006.golden new file mode 100644 index 0000000000000000000000000000000000000000..f31fccda9d0728eea91654a89623c27442cfbe60 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf006.golden @@ -0,0 +1,16 @@ +  …    +  2    +  3    +  4    +      +  5    +  6    +  7    +  …    +  9  1 + 10  1 + 11  1 + 12    +    1 +    1 + 13  1 \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf007.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf007.golden new file mode 100644 index 0000000000000000000000000000000000000000..3c4ec8dbc951a899dc681f2b0774a9d66523c85b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf007.golden @@ -0,0 +1,16 @@ +  …   … +  2   2 +  3   3 +  4   4 +     5 +  5   6 +  6   7 +  7   8 +  …   … +  9  10 + 10  11 + 11  12 + 12    +    13 +    14 + 13  15 \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf008.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf008.golden new file mode 100644 index 0000000000000000000000000000000000000000..f5ec574408debd36b433aed72b3e8881e4a47fd4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf008.golden @@ -0,0 +1,16 @@ +  …   …  +  2   2  +  3   3  +  4   4  +     5  +  5   6  +  6   7  +  7   8  +  …   …  +  9  10  + 10  11  + 11  12  + 12     +    13  +    14  + 13  15  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf009.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf009.golden new file mode 100644 index 0000000000000000000000000000000000000000..7badb5543980ec3a8bb31512ecb69da2396aef5e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf009.golden @@ -0,0 +1,16 @@ +  …   … … +  2   2   +  3   3   +  4   4   +     5 + +  5   6   +  6   7   +  7   8   +  …   … … +  9  10   + 10  11   + 11  12   + 12    - +    13 + +    14 + + 13  15   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf010.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf010.golden new file mode 100644 index 0000000000000000000000000000000000000000..fa3542fb89a9cdfa58e94fc27e8d6e7650176e40 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf010.golden @@ -0,0 +1,16 @@ +  …   …  … +  2   2   +  3   3   +  4   4   +     5 +  +  5   6   +  6   7   +  7   8   +  …   …  … +  9  10   + 10  11   + 11  12   + 12    -  +    13 +  +    14 +  + 13  15   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf011.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf011.golden new file mode 100644 index 0000000000000000000000000000000000000000..980ddd8d547ee6d9622b58b31dc52c050bf07c55 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf011.golden @@ -0,0 +1,16 @@ +  …   …  … +  2   2    +  3   3  … +  4   4  … +     5 + … +  5   6  ) +  6   7    +  7   8  … +  …   …  … +  9  10  } + 10  11    + 11  12  … + 12    - … +    13 + … +    14 + … + 13  15  } \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf012.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf012.golden new file mode 100644 index 0000000000000000000000000000000000000000..118d4c2e1865d9cc50cf1a9f4187792f1c368772 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf012.golden @@ -0,0 +1,16 @@ +  …   …  @… +  2   2    +  3   3  i… +  4   4   … +     5 +  … +  5   6  )  +  6   7    +  7   8  f… +  …   …  @… +  9  10  }  + 10  11    + 11  12  f… + 12    -  … +    13 +  … +    14 +  … + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf013.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf013.golden new file mode 100644 index 0000000000000000000000000000000000000000..abbdb692cb6f6c09df620c88f6b0a6b86e4ef96f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf013.golden @@ -0,0 +1,16 @@ +  …   …  @@… +  2   2    +  3   3  im… +  4   4   … +     5 +  … +  5   6  )  +  6   7    +  7   8  fu… +  …   …  @@… +  9  10  }  + 10  11    + 11  12  fu… + 12    -  … +    13 +  … +    14 +  … + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf014.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf014.golden new file mode 100644 index 0000000000000000000000000000000000000000..afab1410ed5fa9a7ff215fc3f7ca69123ce48981 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf014.golden @@ -0,0 +1,16 @@ +  …   …  @@ … +  2   2    +  3   3  imp… +  4   4   … +     5 +  … +  5   6  )  +  6   7    +  7   8  fun… +  …   …  @@ … +  9  10  }  + 10  11    + 11  12  fun… + 12    -  … +    13 +  … +    14 +  … + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf015.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf015.golden new file mode 100644 index 0000000000000000000000000000000000000000..47898c566201f8d5c4ce8cb87e2e317f9157f323 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf015.golden @@ -0,0 +1,16 @@ +  …   …  @@ -… +  2   2    +  3   3  impo… +  4   4   … +     5 +  … +  5   6  )  +  6   7    +  7   8  func… +  …   …  @@ -… +  9  10  }  + 10  11    + 11  12  func… + 12    -  … +    13 +  … +    14 +  … + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf016.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf016.golden new file mode 100644 index 0000000000000000000000000000000000000000..b5d0f35783d462c9438357bef765d2d60e43ed19 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf016.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2… +  2   2    +  3   3  impor… +  4   4   "… +     5 +  "… +  5   6  )  +  6   7    +  7   8  func … +  …   …  @@ -9… +  9  10  }  + 10  11    + 11  12  func … + 12    -  r… +    13 +  c… +    14 +  r… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf017.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf017.golden new file mode 100644 index 0000000000000000000000000000000000000000..58ed4f19ce4870ebe5dd6296c145d13f08f2044f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf017.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,… +  2   2    +  3   3  import… +  4   4   "f… +     5 +  "s… +  5   6  )  +  6   7    +  7   8  func m… +  …   …  @@ -9,… +  9  10  }  + 10  11    + 11  12  func g… + 12    -  re… +    13 +  co… +    14 +  re… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf018.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf018.golden new file mode 100644 index 0000000000000000000000000000000000000000..73b420a33879df651950fb58d29e985f3d9d5e0a --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf018.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6… +  2   2    +  3   3  import ( +  4   4   "fm… +     5 +  "st… +  5   6  )  +  6   7    +  7   8  func ma… +  …   …  @@ -9,5… +  9  10  }  + 10  11    + 11  12  func ge… + 12    -  ret… +    13 +  con… +    14 +  ret… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf019.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf019.golden new file mode 100644 index 0000000000000000000000000000000000000000..e67fa43de7a3152291a9b08fad158fe4b8d8ff5a --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf019.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 … +  2   2    +  3   3  import (  +  4   4   "fmt" +     5 +  "str… +  5   6  )  +  6   7    +  7   8  func mai… +  …   …  @@ -9,5 … +  9  10  }  + 10  11    + 11  12  func get… + 12    -  retu… +    13 +  cont… +    14 +  retu… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf020.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf020.golden new file mode 100644 index 0000000000000000000000000000000000000000..07e8afd1fb5d87b6f7ac1a833989e9c73f7a08ae --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf020.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +… +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "stri… +  5   6  )  +  6   7    +  7   8  func main… +  …   …  @@ -9,5 +… +  9  10  }  + 10  11    + 11  12  func getC… + 12    -  retur… +    13 +  conte… +    14 +  retur… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf021.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf021.golden new file mode 100644 index 0000000000000000000000000000000000000000..94299ef624a3fbfeb83bfd0a8c412f040314afd4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf021.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2… +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strin… +  5   6  )  +  6   7    +  7   8  func main(… +  …   …  @@ -9,5 +1… +  9  10  }  + 10  11    + 11  12  func getCo… + 12    -  return… +    13 +  conten… +    14 +  return… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf022.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf022.golden new file mode 100644 index 0000000000000000000000000000000000000000..38c4c162a2bdfcbb2aec1952c7d797dadbe8c9d9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf022.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,… +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "string… +  5   6  )  +  6   7    +  7   8  func main()… +  …   …  @@ -9,5 +10… +  9  10  }  + 10  11    + 11  12  func getCon… + 12    -  return … +    13 +  content… +    14 +  return … + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf023.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf023.golden new file mode 100644 index 0000000000000000000000000000000000000000..8d96b56fe8a222fadf2b62364256c2597a4f5e2d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf023.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7… +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings" +  5   6  )  +  6   7    +  7   8  func main() { +  …   …  @@ -9,5 +10,… +  9  10  }  + 10  11    + 11  12  func getCont… + 12    -  return "… +    13 +  content … +    14 +  return c… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf024.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf024.golden new file mode 100644 index 0000000000000000000000000000000000000000..009000c442042aabb50bdff598002b1b92e5d0fc --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf024.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 … +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6… +  9  10  }  + 10  11    + 11  12  func getConte… + 12    -  return "H… +    13 +  content :… +    14 +  return co… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf025.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf025.golden new file mode 100644 index 0000000000000000000000000000000000000000..36412d17092b292702df8dccb64da381f6b7439f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf025.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @… +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 … +  9  10  }  + 10  11    + 11  12  func getConten… + 12    -  return "He… +    13 +  content :=… +    14 +  return con… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf026.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf026.golden new file mode 100644 index 0000000000000000000000000000000000000000..d6ce5b40b7f1ded424b842c7419ebfd3422d8bea --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf026.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@  +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @… +  9  10  }  + 10  11    + 11  12  func getContent… + 12    -  return "Hel… +    13 +  content := … +    14 +  return cont… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf027.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf027.golden new file mode 100644 index 0000000000000000000000000000000000000000..1d8d1a7b102989665a6fb5daa3f45671e240bb9a --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf027.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@  +  9  10  }  + 10  11    + 11  12  func getContent(… + 12    -  return "Hell… +    13 +  content := s… +    14 +  return conte… + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf028.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf028.golden new file mode 100644 index 0000000000000000000000000000000000000000..cd64972ae97ea3a43e6d8bbec01f6556e14ba209 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf028.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent()… + 12    -  return "Hello… +    13 +  content := st… +    14 +  return content + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf029.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf029.golden new file mode 100644 index 0000000000000000000000000000000000000000..9630522016ffb5c9fbcc1b35c79af01807a461d6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf029.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() … + 12    -  return "Hello,… +    13 +  content := str… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf030.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf030.golden new file mode 100644 index 0000000000000000000000000000000000000000..c968b68bbc5571f9e3a0ca7a57b8465c8d5d501c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf030.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() s… + 12    -  return "Hello, … +    13 +  content := stri… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf031.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf031.golden new file mode 100644 index 0000000000000000000000000000000000000000..1e8e394258062076591dbadd12ab6e3062b354e1 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf031.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() st… + 12    -  return "Hello, w… +    13 +  content := strin… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf032.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf032.golden new file mode 100644 index 0000000000000000000000000000000000000000..106501b3c9003cd8d663ee80f6ff7e8c6432e413 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf032.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() str… + 12    -  return "Hello, wo… +    13 +  content := string… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf033.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf033.golden new file mode 100644 index 0000000000000000000000000000000000000000..f1dcb3abfb3eda3d465699211b3fae06258e55c5 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf033.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() stri… + 12    -  return "Hello, wor… +    13 +  content := strings… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf034.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf034.golden new file mode 100644 index 0000000000000000000000000000000000000000..5fa2170cf92f1881d4ba6e7f7a1b21a7092ed448 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf034.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() strin… + 12    -  return "Hello, worl… +    13 +  content := strings.… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf035.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf035.golden new file mode 100644 index 0000000000000000000000000000000000000000..cc742db50aa4a556f10f963483e267783e2ae463 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf035.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string… + 12    -  return "Hello, world… +    13 +  content := strings.T… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf036.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf036.golden new file mode 100644 index 0000000000000000000000000000000000000000..9ec6dbba298c91f82166508728172710372b77b5 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf036.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string { + 12    -  return "Hello, world!" +    13 +  content := strings.To… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf037.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf037.golden new file mode 100644 index 0000000000000000000000000000000000000000..f33c7a7aef1dc8c2d56e61cfbef846fdf4641ec6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf037.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToU… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf038.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf038.golden new file mode 100644 index 0000000000000000000000000000000000000000..c87bc8d61c1341c9a066c501ff5b230b04ce0277 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf038.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUp… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf039.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf039.golden new file mode 100644 index 0000000000000000000000000000000000000000..ab2f47e1d7e5ada9820747d9305cba1e7aa63710 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf039.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpp… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf040.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf040.golden new file mode 100644 index 0000000000000000000000000000000000000000..bc1c6c04db45d3d8dfddf23440dcfa430cec7fb0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf040.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUppe… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf041.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf041.golden new file mode 100644 index 0000000000000000000000000000000000000000..aa382a513632ffd40e9fee31463d5cb29213e441 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf041.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf042.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf042.golden new file mode 100644 index 0000000000000000000000000000000000000000..6c721a82c4afc6423070b7c07cf909ec055bcc5d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf042.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper(… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf043.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf043.golden new file mode 100644 index 0000000000000000000000000000000000000000..d2d80c72db4368679e3cc87c89143633cec3d8fd --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf043.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf044.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf044.golden new file mode 100644 index 0000000000000000000000000000000000000000..943719010fe4e96b29d702c2e49533bc5577cd2b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf044.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("H… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf045.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf045.golden new file mode 100644 index 0000000000000000000000000000000000000000..591ce67300df856c778afe8c883818cd0ef40918 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf045.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("He… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf046.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf046.golden new file mode 100644 index 0000000000000000000000000000000000000000..25ab875c4f1b5cb40ce08eb24503e93aa79bb083 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf046.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hel… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf047.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf047.golden new file mode 100644 index 0000000000000000000000000000000000000000..58a8199865345c094709c677c238af4d55126867 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf047.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hell… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf048.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf048.golden new file mode 100644 index 0000000000000000000000000000000000000000..83ede19e2d8d68234852af840c82cc98d6358968 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf048.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf049.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf049.golden new file mode 100644 index 0000000000000000000000000000000000000000..f531bcbf029d81258a3a77073cc469dfab59da36 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf049.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello,… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf050.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf050.golden new file mode 100644 index 0000000000000000000000000000000000000000..42d3bf74913c04219f87a6044becf0967ae35046 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf050.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, … +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf051.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf051.golden new file mode 100644 index 0000000000000000000000000000000000000000..8a0e974e715ecfd2d15beb026b8887eb98aa15c2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf051.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, W… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf052.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf052.golden new file mode 100644 index 0000000000000000000000000000000000000000..5eaaa47e038ee480ebd8825cc8b7cfe3b05686f7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf052.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, Wo… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf053.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf053.golden new file mode 100644 index 0000000000000000000000000000000000000000..08ad6ddffccc6ba92cf63749775a5ccbb6ffdfec --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf053.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, Wor… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf054.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf054.golden new file mode 100644 index 0000000000000000000000000000000000000000..2dff941c3c03509f116b639f725995df15e050e7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf054.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, Worl… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf055.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf055.golden new file mode 100644 index 0000000000000000000000000000000000000000..6c4244529a4fa5aa863b4d7654fa230417d8415f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf055.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf056.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf056.golden new file mode 100644 index 0000000000000000000000000000000000000000..e142e86ec29f9ccfc392512fb6a1ebdd7ef47b79 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf056.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!… +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf057.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf057.golden new file mode 100644 index 0000000000000000000000000000000000000000..0fc779146b016da6d50f41adef48995ac66ee3ce --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf057.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!") +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf058.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf058.golden new file mode 100644 index 0000000000000000000000000000000000000000..4833a8a0263aada505f2e115c5dfb9fc469def67 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf058.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf059.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf059.golden new file mode 100644 index 0000000000000000000000000000000000000000..7b2771b39f26769a36ce9acd7c5b13bf61108298 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf059.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf060.golden b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf060.golden new file mode 100644 index 0000000000000000000000000000000000000000..6cff1caaad1de797a272c79b02e692268b5649da --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewWidth/Unified/WidthOf060.golden @@ -0,0 +1,16 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf00.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf00.golden new file mode 100644 index 0000000000000000000000000000000000000000..9ec2cc1f1d60f2ab2e26aea0ac9860accd927534 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf00.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  )   5  )  +  6     6    +  7  func main() {   7  func main() {  +  8 -  fmt.Println("Hello,…  8 +  content := "Hello, … +       9 +  fmt.Println(content) +  9  }  10  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf01.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf01.golden new file mode 100644 index 0000000000000000000000000000000000000000..473d996d55dd396c57a3f54ac33080501d3f692c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf01.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …unc main() {   7  …unc main() {  +  8 -… fmt.Println("Hello, …  8 +… content := "Hello, w… +       9 +… fmt.Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf02.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf02.golden new file mode 100644 index 0000000000000000000000000000000000000000..270924bb42b6a2c148b550ae67c74fdb213980a9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf02.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …nc main() {   7  …nc main() {  +  8 -… fmt.Println("Hello, w…  8 +… content := "Hello, wo… +       9 +… fmt.Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf03.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf03.golden new file mode 100644 index 0000000000000000000000000000000000000000..a2d2007c22d981307c17247a23f0096a7d2f72b0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf03.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …c main() {   7  …c main() {  +  8 -… fmt.Println("Hello, wo…  8 +… content := "Hello, wor… +       9 +… fmt.Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf04.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf04.golden new file mode 100644 index 0000000000000000000000000000000000000000..407565b5ce6fe40545656ef814309fe4f35e7679 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf04.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  … main() {   7  … main() {  +  8 -…fmt.Println("Hello, wor…  8 +…content := "Hello, worl… +       9 +…fmt.Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf05.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf05.golden new file mode 100644 index 0000000000000000000000000000000000000000..7e2988668b1be238ffe74db71886312f18c59a9d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf05.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …main() {   7  …main() {  +  8 -…mt.Println("Hello, worl…  8 +…ontent := "Hello, world… +       9 +…mt.Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf06.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf06.golden new file mode 100644 index 0000000000000000000000000000000000000000..c0eebb94811fc3963094b942a6e3d92313570901 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf06.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …ain() {   7  …ain() {  +  8 -…t.Println("Hello, world…  8 +…ntent := "Hello, world!" +       9 +…t.Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf07.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf07.golden new file mode 100644 index 0000000000000000000000000000000000000000..d2d3307543e4ce996c82c51a5c30a75155c51865 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf07.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …in() {   7  …in() {  +  8 -….Println("Hello, world!…  8 +…tent := "Hello, world!"  +       9 +….Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf08.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf08.golden new file mode 100644 index 0000000000000000000000000000000000000000..13d4a33d04fe3bf2a229c982082f9a13203ced3e --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf08.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …n() {   7  …n() {  +  8 -…Println("Hello, world!")  8 +…ent := "Hello, world!"  +       9 +…Println(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf09.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf09.golden new file mode 100644 index 0000000000000000000000000000000000000000..393ec8889fce9e10eaf03c6648b160b5193d1f35 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf09.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …() {   7  …() {  +  8 -…rintln("Hello, world!")   8 +…nt := "Hello, world!"  +       9 +…rintln(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf10.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf10.golden new file mode 100644 index 0000000000000000000000000000000000000000..90dcd606b64433a056bcf54b69e3467251d465a1 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf10.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …) {   7  …) {  +  8 -…intln("Hello, world!")   8 +…t := "Hello, world!"  +       9 +…intln(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf11.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf11.golden new file mode 100644 index 0000000000000000000000000000000000000000..cede44c77dc6a1ad54e03e33a855ec1b8bee42eb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf11.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  … {   7  … {  +  8 -…ntln("Hello, world!")   8 +… := "Hello, world!"  +       9 +…ntln(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf12.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf12.golden new file mode 100644 index 0000000000000000000000000000000000000000..f7713314c869c193271796f8b44669708c12fd51 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf12.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …{   7  …{  +  8 -…tln("Hello, world!")   8 +…:= "Hello, world!"  +       9 +…tln(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf13.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf13.golden new file mode 100644 index 0000000000000000000000000000000000000000..ec342bcd1a9dc48b955f1c585af2fd3c15591cdd --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf13.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…ln("Hello, world!")   8 +…= "Hello, world!"  +       9 +…ln(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf14.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf14.golden new file mode 100644 index 0000000000000000000000000000000000000000..53cea6723e9d28d66cfac2371dc992d70a2bfd90 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf14.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…n("Hello, world!")   8 +… "Hello, world!"  +       9 +…n(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf15.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf15.golden new file mode 100644 index 0000000000000000000000000000000000000000..2fb5652a4e2d05f3b4efd6e58cc9ecb71ce545c0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf15.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…("Hello, world!")   8 +…"Hello, world!"  +       9 +…(content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf16.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf16.golden new file mode 100644 index 0000000000000000000000000000000000000000..adf8f07ef00c85c0bffc683abd31741b38d8f0d2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf16.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…"Hello, world!")   8 +…Hello, world!"  +       9 +…content)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf17.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf17.golden new file mode 100644 index 0000000000000000000000000000000000000000..d7b7a7ea86c9d6477465c61aead42e974e1b938a --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf17.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…Hello, world!")   8 +…ello, world!"  +       9 +…ontent)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf18.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf18.golden new file mode 100644 index 0000000000000000000000000000000000000000..715237891b424eb91814b91a287b17d063a1d2b8 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf18.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…ello, world!")   8 +…llo, world!"  +       9 +…ntent)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf19.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf19.golden new file mode 100644 index 0000000000000000000000000000000000000000..6fa5925e13d0f617d23c8f62e692bbef68969dd2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf19.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…llo, world!")   8 +…lo, world!"  +       9 +…tent)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf20.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf20.golden new file mode 100644 index 0000000000000000000000000000000000000000..c0bf9235426e010557385870a5dd95e74bffb6b7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Split/XOffsetOf20.golden @@ -0,0 +1,7 @@ +  …  @@ -5,5 +5,6 @@    …    +  5  …   5  …  +  6     6    +  7  …   7  …  +  8 -…lo, world!")   8 +…o, world!"  +       9 +…ent)  +  9  …  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf00.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf00.golden new file mode 100644 index 0000000000000000000000000000000000000000..94b2873d06832d68d902b591c3e8ed07960d165f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf00.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  )  +  6   6    +  7   7  func main() {  +  8    -  fmt.Println("Hello, world!")  +     8 +  content := "Hello, world!"  +     9 +  fmt.Println(content)  +  9  10  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf01.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf01.golden new file mode 100644 index 0000000000000000000000000000000000000000..c9cf2ba5c67d9a207c92d303d464007dde1befb4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf01.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …unc main() {  +  8    -… fmt.Println("Hello, world!")  +     8 +… content := "Hello, world!"  +     9 +… fmt.Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf02.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf02.golden new file mode 100644 index 0000000000000000000000000000000000000000..83de454cb48931a7515d520410cfd3c834e3c1f7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf02.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …nc main() {  +  8    -… fmt.Println("Hello, world!")  +     8 +… content := "Hello, world!"  +     9 +… fmt.Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf03.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf03.golden new file mode 100644 index 0000000000000000000000000000000000000000..953b5d6e18c97bfab677573107546b9c406714d9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf03.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …c main() {  +  8    -… fmt.Println("Hello, world!")  +     8 +… content := "Hello, world!"  +     9 +… fmt.Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf04.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf04.golden new file mode 100644 index 0000000000000000000000000000000000000000..30ef912446ba3f5d31a86199f77319a756078f91 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf04.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  … main() {  +  8    -…fmt.Println("Hello, world!")  +     8 +…content := "Hello, world!"  +     9 +…fmt.Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf05.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf05.golden new file mode 100644 index 0000000000000000000000000000000000000000..e3068f96ee77bb62ddf13203d6d90c0689f80428 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf05.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …main() {  +  8    -…mt.Println("Hello, world!")  +     8 +…ontent := "Hello, world!"  +     9 +…mt.Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf06.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf06.golden new file mode 100644 index 0000000000000000000000000000000000000000..2112d73c61e72d0d027815ec85a54e9f60ca3358 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf06.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …ain() {  +  8    -…t.Println("Hello, world!")  +     8 +…ntent := "Hello, world!"  +     9 +…t.Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf07.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf07.golden new file mode 100644 index 0000000000000000000000000000000000000000..54b71be135d454289d77e7a02657d1555b8ecd33 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf07.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …in() {  +  8    -….Println("Hello, world!")  +     8 +…tent := "Hello, world!"  +     9 +….Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf08.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf08.golden new file mode 100644 index 0000000000000000000000000000000000000000..722115cc24309d4cf633ea5a6e566073047f30d0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf08.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …n() {  +  8    -…Println("Hello, world!")  +     8 +…ent := "Hello, world!"  +     9 +…Println(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf09.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf09.golden new file mode 100644 index 0000000000000000000000000000000000000000..5f7bdbdcdd5be4cd11a389c0c783a78183b7bdf8 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf09.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …() {  +  8    -…rintln("Hello, world!")  +     8 +…nt := "Hello, world!"  +     9 +…rintln(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf10.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf10.golden new file mode 100644 index 0000000000000000000000000000000000000000..45559be79cdb9ededcc648e270de7cd35e7d2568 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf10.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …) {  +  8    -…intln("Hello, world!")  +     8 +…t := "Hello, world!"  +     9 +…intln(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf11.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf11.golden new file mode 100644 index 0000000000000000000000000000000000000000..e43d883ca53c33655ef3cba3fcfb8c198f6ba08b --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf11.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  … {  +  8    -…ntln("Hello, world!")  +     8 +… := "Hello, world!"  +     9 +…ntln(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf12.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf12.golden new file mode 100644 index 0000000000000000000000000000000000000000..f869ba9a4296fea7bc075dee39d803bfb593571f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf12.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …{  +  8    -…tln("Hello, world!")  +     8 +…:= "Hello, world!"  +     9 +…tln(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf13.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf13.golden new file mode 100644 index 0000000000000000000000000000000000000000..0c6ceea7ffb1bc8538ecfa791d93ddafbda184ab --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf13.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…ln("Hello, world!")  +     8 +…= "Hello, world!"  +     9 +…ln(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf14.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf14.golden new file mode 100644 index 0000000000000000000000000000000000000000..e5189e842557d9fdb3c1bbcb64bcb88022b5e3fb --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf14.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…n("Hello, world!")  +     8 +… "Hello, world!"  +     9 +…n(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf15.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf15.golden new file mode 100644 index 0000000000000000000000000000000000000000..5ae21ff9d9614a3a938886f54621c38d479f6aaf --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf15.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…("Hello, world!")  +     8 +…"Hello, world!"  +     9 +…(content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf16.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf16.golden new file mode 100644 index 0000000000000000000000000000000000000000..0fada9a25ff6e1292855cecb452b84ae446214ca --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf16.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…"Hello, world!")  +     8 +…Hello, world!"  +     9 +…content)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf17.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf17.golden new file mode 100644 index 0000000000000000000000000000000000000000..77edd36e83f048673a1a1962ff0839bbd291a2dc --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf17.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…Hello, world!")  +     8 +…ello, world!"  +     9 +…ontent)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf18.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf18.golden new file mode 100644 index 0000000000000000000000000000000000000000..84a830655e2f83046e03421608ce2f767653e28f --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf18.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…ello, world!")  +     8 +…llo, world!"  +     9 +…ntent)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf19.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf19.golden new file mode 100644 index 0000000000000000000000000000000000000000..9fb8b3b88efda9d50ad6cde9fe1d57305dd7fea6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf19.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…llo, world!")  +     8 +…lo, world!"  +     9 +…tent)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf20.golden b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf20.golden new file mode 100644 index 0000000000000000000000000000000000000000..410d365f438ae62a002ef06b8e9fc2867545119c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewXOffset/Unified/XOffsetOf20.golden @@ -0,0 +1,8 @@ +  …   …  @@ -5,5 +5,6 @@   +  5   5  …  +  6   6  …  +  7   7  …  +  8    -…lo, world!")  +     8 +…o, world!"  +     9 +…ent)  +  9  10  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf00.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf00.golden new file mode 100644 index 0000000000000000000000000000000000000000..8d4a293fdd17ce5cbd8d709656573105a8cc7b09 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf00.golden @@ -0,0 +1,5 @@ +  …  @@ -2,6 +2,7 @@    …    +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf01.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf01.golden new file mode 100644 index 0000000000000000000000000000000000000000..59b706f531489a560427504d00b4ed513a2f0429 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf01.golden @@ -0,0 +1,5 @@ +  2     2    +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf02.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf02.golden new file mode 100644 index 0000000000000000000000000000000000000000..a3e47b440f42bcadf6644a9ce09b4a3eced04193 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf02.golden @@ -0,0 +1,5 @@ +  3  import (   3  import (  +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf03.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf03.golden new file mode 100644 index 0000000000000000000000000000000000000000..823ceecf70c4ba985ab52af71e5d73b502e486ef --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf03.golden @@ -0,0 +1,5 @@ +  4   "fmt"   4   "fmt"  +       5 +  "strings"  +  5  )   6  )  +  6     7    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf04.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf04.golden new file mode 100644 index 0000000000000000000000000000000000000000..51cc05362f49e9733efb56c02af96d584ed3b507 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf04.golden @@ -0,0 +1,5 @@ +       5 +  "strings"  +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf05.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf05.golden new file mode 100644 index 0000000000000000000000000000000000000000..f8052af3a03a3e0d71c7e6914ae61e0cfe1cd208 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf05.golden @@ -0,0 +1,5 @@ +  5  )   6  )  +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf06.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf06.golden new file mode 100644 index 0000000000000000000000000000000000000000..00209b6b75b82c568e0f04349dd366a8c303b9e0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf06.golden @@ -0,0 +1,5 @@ +  6     7    +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf07.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf07.golden new file mode 100644 index 0000000000000000000000000000000000000000..49f92c490c17a8d125f1a7ca6854573e72ef3e65 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf07.golden @@ -0,0 +1,5 @@ +  7  func main() {   8  func main() {  +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf08.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf08.golden new file mode 100644 index 0000000000000000000000000000000000000000..6f01089b12f29dff3c4a31bff325a543dc660355 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf08.golden @@ -0,0 +1,5 @@ +  …  @@ -9,5 +10,6 @@    …    +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf09.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf09.golden new file mode 100644 index 0000000000000000000000000000000000000000..d368d1e85520195ead3015f57012ffefa0502d0d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf09.golden @@ -0,0 +1,5 @@ +  9  }  10  }  + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +  …  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf10.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf10.golden new file mode 100644 index 0000000000000000000000000000000000000000..09c4fa2b1b7eb1941caf79650cd494e9b56727d0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf10.golden @@ -0,0 +1,5 @@ + 10    11    + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf11.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf11.golden new file mode 100644 index 0000000000000000000000000000000000000000..fca02b528feae2e2620f53d77bdbdc55e06096f0 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf11.golden @@ -0,0 +1,5 @@ + 11  func getContent() string {  12  func getContent() string {  + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf12.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf12.golden new file mode 100644 index 0000000000000000000000000000000000000000..5e347b97b1af201404fc830d47501dac3d6b8b36 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf12.golden @@ -0,0 +1,5 @@ + 12 -  return "Hello, world!"  13 +  content := strings.ToUpper("Hello, World!")  +      14 +  return content  + 13  }  15  }  +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf13.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf13.golden new file mode 100644 index 0000000000000000000000000000000000000000..1496bd70374c1879a7b5a628ab923124242508c1 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf13.golden @@ -0,0 +1,5 @@ +      14 +  return content  + 13  }  15  }  +           +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf14.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf14.golden new file mode 100644 index 0000000000000000000000000000000000000000..80b0d239540b60cb3e84a3323a8085b86ad428fa --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf14.golden @@ -0,0 +1,5 @@ + 13  }  15  }  +           +           +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf15.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf15.golden new file mode 100644 index 0000000000000000000000000000000000000000..c989070ae313dcd1212208115acf3603671ceab6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf15.golden @@ -0,0 +1,5 @@ +           +           +           +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf16.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf16.golden new file mode 100644 index 0000000000000000000000000000000000000000..c989070ae313dcd1212208115acf3603671ceab6 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Split/YOffsetOf16.golden @@ -0,0 +1,5 @@ +           +           +           +           +           \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf00.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf00.golden new file mode 100644 index 0000000000000000000000000000000000000000..e11e6df667cfa9dc3d909f30fef8895c16dc85c2 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf00.golden @@ -0,0 +1,5 @@ +  …   …  @@ -2,6 +2,7 @@   +  2   2    +  3   3  import (  +  4   4   "fmt"  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf01.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf01.golden new file mode 100644 index 0000000000000000000000000000000000000000..52c1ff0ee9ddec7f746590d4a5efd7630eb97fd4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf01.golden @@ -0,0 +1,5 @@ +  2   2    +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf02.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf02.golden new file mode 100644 index 0000000000000000000000000000000000000000..0d3ef94eccf5119a182afaecfdf5ad85880d3271 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf02.golden @@ -0,0 +1,5 @@ +  3   3  import (  +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf03.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf03.golden new file mode 100644 index 0000000000000000000000000000000000000000..37d7ae5851327dd0d05ecb6cfc8d1dcc447c0be7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf03.golden @@ -0,0 +1,5 @@ +  4   4   "fmt"  +     5 +  "strings"  +  5   6  )  +  6   7    +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf04.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf04.golden new file mode 100644 index 0000000000000000000000000000000000000000..cdc84e4407a0ac070af67944cbf2b470182a865d --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf04.golden @@ -0,0 +1,5 @@ +     5 +  "strings"  +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf05.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf05.golden new file mode 100644 index 0000000000000000000000000000000000000000..7d36fccbe412a8d49e3c1bc78ae91d2f5433e4de --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf05.golden @@ -0,0 +1,5 @@ +  5   6  )  +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf06.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf06.golden new file mode 100644 index 0000000000000000000000000000000000000000..32c230ed26134c7427738a89829c8c511ea97922 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf06.golden @@ -0,0 +1,5 @@ +  6   7    +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf07.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf07.golden new file mode 100644 index 0000000000000000000000000000000000000000..95f4c23477af7c7b87731b4170b96ce3bf94e755 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf07.golden @@ -0,0 +1,5 @@ +  7   8  func main() {  +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf08.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf08.golden new file mode 100644 index 0000000000000000000000000000000000000000..bf5e674b322acebb23134ff841fbbbfa27eeb752 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf08.golden @@ -0,0 +1,5 @@ +  …   …  @@ -9,5 +10,6 @@   +  9  10  }  + 10  11    + 11  12  func getContent() string {  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf09.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf09.golden new file mode 100644 index 0000000000000000000000000000000000000000..ad0bfca4be7b761b73d833849de6b0c369d92586 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf09.golden @@ -0,0 +1,5 @@ +  9  10  }  + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf10.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf10.golden new file mode 100644 index 0000000000000000000000000000000000000000..5998ba6ec7df46f91fe969858c19559fe873c330 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf10.golden @@ -0,0 +1,5 @@ + 10  11    + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +  …   …  …  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf11.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf11.golden new file mode 100644 index 0000000000000000000000000000000000000000..5f686c57c49ca7f7db94c766fff568f55725fa36 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf11.golden @@ -0,0 +1,5 @@ + 11  12  func getContent() string {  + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf12.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf12.golden new file mode 100644 index 0000000000000000000000000000000000000000..1d8d95395c0e5900b270bb4d6f03ddef56f9bbe3 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf12.golden @@ -0,0 +1,5 @@ + 12    -  return "Hello, world!"  +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf13.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf13.golden new file mode 100644 index 0000000000000000000000000000000000000000..469accfc86b39051e1f0d22944328f5ae0ddb911 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf13.golden @@ -0,0 +1,5 @@ +    13 +  content := strings.ToUpper("Hello, World!")  +    14 +  return content  + 13  15  }  +         +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf14.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf14.golden new file mode 100644 index 0000000000000000000000000000000000000000..547e576181a8e1abe5d24f3fce8f5dce2988bb3c --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf14.golden @@ -0,0 +1,5 @@ +    14 +  return content  + 13  15  }  +         +         +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf15.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf15.golden new file mode 100644 index 0000000000000000000000000000000000000000..005a5ea98096a1a703fb31ccd9b6e94ee0fe874a --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf15.golden @@ -0,0 +1,5 @@ + 13  15  }  +         +         +         +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf16.golden b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf16.golden new file mode 100644 index 0000000000000000000000000000000000000000..933f56b9d1fc148d6d394cb271299f4eddc0a739 --- /dev/null +++ b/internal/exp/diffview/testdata/TestDiffViewYOffset/Unified/YOffsetOf16.golden @@ -0,0 +1,5 @@ +         +         +         +         +         \ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestMultipleHunks.after b/internal/exp/diffview/testdata/TestMultipleHunks.after new file mode 100644 index 0000000000000000000000000000000000000000..b78a823fa5c0f744c6eb3196a890338f92e40ada --- /dev/null +++ b/internal/exp/diffview/testdata/TestMultipleHunks.after @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "strings" +) + +func main() { + fmt.Println(getContent()) +} + +func getContent() string { + content := strings.ToUpper("Hello, World!") + return content +} diff --git a/internal/exp/diffview/testdata/TestMultipleHunks.before b/internal/exp/diffview/testdata/TestMultipleHunks.before new file mode 100644 index 0000000000000000000000000000000000000000..97661af36e6d8fe0900a32dc9cceea7960c9062f --- /dev/null +++ b/internal/exp/diffview/testdata/TestMultipleHunks.before @@ -0,0 +1,13 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(getContent()) +} + +func getContent() string { + return "Hello, world!" +} diff --git a/internal/exp/diffview/testdata/TestNarrow.after b/internal/exp/diffview/testdata/TestNarrow.after new file mode 100644 index 0000000000000000000000000000000000000000..2bb9b90bce52274e75ca3ebcf9ffd4e12d86126b --- /dev/null +++ b/internal/exp/diffview/testdata/TestNarrow.after @@ -0,0 +1,3 @@ +d +e +f diff --git a/internal/exp/diffview/testdata/TestNarrow.before b/internal/exp/diffview/testdata/TestNarrow.before new file mode 100644 index 0000000000000000000000000000000000000000..de980441c3ab03a8c07dda1ad27b8a11f39deb1e --- /dev/null +++ b/internal/exp/diffview/testdata/TestNarrow.before @@ -0,0 +1,3 @@ +a +b +c diff --git a/internal/exp/diffview/testdata/TestTabs.after b/internal/exp/diffview/testdata/TestTabs.after new file mode 100644 index 0000000000000000000000000000000000000000..26b88f61224561d442b23473ce6b9daaf761aee9 --- /dev/null +++ b/internal/exp/diffview/testdata/TestTabs.after @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "strings" +) + +func main() { + fmt.Println(getContent()) +} + +func getContent() string { + content := strings.ToUpper("Hello, World!") + return content +} diff --git a/internal/exp/diffview/testdata/TestTabs.before b/internal/exp/diffview/testdata/TestTabs.before new file mode 100644 index 0000000000000000000000000000000000000000..72d7ebc2699bfd859311b85e3193e6c87013672f --- /dev/null +++ b/internal/exp/diffview/testdata/TestTabs.before @@ -0,0 +1,13 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(getContent()) +} + +func getContent() string { + return "Hello, world!" +} diff --git a/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLines/Content.golden b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLines/Content.golden new file mode 100644 index 0000000000000000000000000000000000000000..b0d3d504a4dc9e8aabb220d7b03f699e7286e765 --- /dev/null +++ b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLines/Content.golden @@ -0,0 +1,11 @@ +--- main.go ++++ main.go +@@ -5,5 +5,6 @@ + ) + + func main() { +- fmt.Println("Hello, World!") ++ content := "Hello, World!" ++ fmt.Println(content) + } +\ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLines/JSON.golden b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLines/JSON.golden new file mode 100644 index 0000000000000000000000000000000000000000..dc02fd23ed304cfcf868dd661f685ad7dbb6754f --- /dev/null +++ b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLines/JSON.golden @@ -0,0 +1,40 @@ +{ + "From": "main.go", + "To": "main.go", + "Hunks": [ + { + "FromLine": 5, + "ToLine": 5, + "Lines": [ + { + "Kind": 2, + "Content": "\t)\n" + }, + { + "Kind": 2, + "Content": "\n" + }, + { + "Kind": 2, + "Content": "\tfunc main() {\n" + }, + { + "Kind": 0, + "Content": "\t\tfmt.Println(\"Hello, World!\")\n" + }, + { + "Kind": 1, + "Content": "\t\tcontent := \"Hello, World!\"\n" + }, + { + "Kind": 1, + "Content": "\t\tfmt.Println(content)\n" + }, + { + "Kind": 2, + "Content": "\t}" + } + ] + } + ] +} diff --git a/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusOne/Content.golden b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusOne/Content.golden new file mode 100644 index 0000000000000000000000000000000000000000..95ab1aca68b72158f829ef6391dc30771e3ace52 --- /dev/null +++ b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusOne/Content.golden @@ -0,0 +1,12 @@ +--- main.go ++++ main.go +@@ -4,6 +4,7 @@ + "fmt" + ) + + func main() { +- fmt.Println("Hello, World!") ++ content := "Hello, World!" ++ fmt.Println(content) + } +\ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusOne/JSON.golden b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusOne/JSON.golden new file mode 100644 index 0000000000000000000000000000000000000000..20adf2e182705257388d13baba06198367f4c9b7 --- /dev/null +++ b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusOne/JSON.golden @@ -0,0 +1,44 @@ +{ + "From": "main.go", + "To": "main.go", + "Hunks": [ + { + "FromLine": 4, + "ToLine": 4, + "Lines": [ + { + "Kind": 2, + "Content": "\t\t\"fmt\"\n" + }, + { + "Kind": 2, + "Content": "\t)\n" + }, + { + "Kind": 2, + "Content": "\n" + }, + { + "Kind": 2, + "Content": "\tfunc main() {\n" + }, + { + "Kind": 0, + "Content": "\t\tfmt.Println(\"Hello, World!\")\n" + }, + { + "Kind": 1, + "Content": "\t\tcontent := \"Hello, World!\"\n" + }, + { + "Kind": 1, + "Content": "\t\tfmt.Println(content)\n" + }, + { + "Kind": 2, + "Content": "\t}" + } + ] + } + ] +} diff --git a/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusTwo/Content.golden b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusTwo/Content.golden new file mode 100644 index 0000000000000000000000000000000000000000..01b92d2512090f1ff2ea624c31fbeb1cae9235b4 --- /dev/null +++ b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusTwo/Content.golden @@ -0,0 +1,13 @@ +--- main.go ++++ main.go +@@ -3,7 +3,8 @@ + import ( + "fmt" + ) + + func main() { +- fmt.Println("Hello, World!") ++ content := "Hello, World!" ++ fmt.Println(content) + } +\ No newline at end of file diff --git a/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusTwo/JSON.golden b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusTwo/JSON.golden new file mode 100644 index 0000000000000000000000000000000000000000..2f0df7c1703ffa1ddc929265be0770d29ec2aec3 --- /dev/null +++ b/internal/exp/diffview/testdata/TestUdiff/ToUnifiedDiff/DefaultContextLinesPlusTwo/JSON.golden @@ -0,0 +1,48 @@ +{ + "From": "main.go", + "To": "main.go", + "Hunks": [ + { + "FromLine": 3, + "ToLine": 3, + "Lines": [ + { + "Kind": 2, + "Content": "\timport (\n" + }, + { + "Kind": 2, + "Content": "\t\t\"fmt\"\n" + }, + { + "Kind": 2, + "Content": "\t)\n" + }, + { + "Kind": 2, + "Content": "\n" + }, + { + "Kind": 2, + "Content": "\tfunc main() {\n" + }, + { + "Kind": 0, + "Content": "\t\tfmt.Println(\"Hello, World!\")\n" + }, + { + "Kind": 1, + "Content": "\t\tcontent := \"Hello, World!\"\n" + }, + { + "Kind": 1, + "Content": "\t\tfmt.Println(content)\n" + }, + { + "Kind": 2, + "Content": "\t}" + } + ] + } + ] +} diff --git a/internal/exp/diffview/testdata/TestUdiff/Unified.golden b/internal/exp/diffview/testdata/TestUdiff/Unified.golden new file mode 100644 index 0000000000000000000000000000000000000000..b0d3d504a4dc9e8aabb220d7b03f699e7286e765 --- /dev/null +++ b/internal/exp/diffview/testdata/TestUdiff/Unified.golden @@ -0,0 +1,11 @@ +--- main.go ++++ main.go +@@ -5,5 +5,6 @@ + ) + + func main() { +- fmt.Println("Hello, World!") ++ content := "Hello, World!" ++ fmt.Println(content) + } +\ No newline at end of file diff --git a/internal/exp/diffview/udiff_test.go b/internal/exp/diffview/udiff_test.go new file mode 100644 index 0000000000000000000000000000000000000000..400c5ba0cd143ec5398316f1910b884479cde2b7 --- /dev/null +++ b/internal/exp/diffview/udiff_test.go @@ -0,0 +1,92 @@ +package diffview_test + +import ( + "bytes" + "encoding/json" + "testing" + + "github.com/aymanbagabas/go-udiff" + "github.com/aymanbagabas/go-udiff/myers" + "github.com/charmbracelet/x/exp/golden" +) + +func TestUdiff(t *testing.T) { + before := `package main + + import ( + "fmt" + ) + + func main() { + fmt.Println("Hello, World!") + }` + + after := `package main + + import ( + "fmt" + ) + + func main() { + content := "Hello, World!" + fmt.Println(content) + }` + + t.Run("Unified", func(t *testing.T) { + content := udiff.Unified("main.go", "main.go", before, after) + golden.RequireEqual(t, []byte(content)) + }) + + t.Run("ToUnifiedDiff", func(t *testing.T) { + toUnifiedDiff := func(t *testing.T, before, after string, contextLines int) udiff.UnifiedDiff { + edits := myers.ComputeEdits(before, after) //nolint:staticcheck + unifiedDiff, err := udiff.ToUnifiedDiff("main.go", "main.go", before, edits, contextLines) + if err != nil { + t.Fatalf("ToUnifiedDiff failed: %v", err) + } + return unifiedDiff + } + toJSON := func(t *testing.T, unifiedDiff udiff.UnifiedDiff) []byte { + var buff bytes.Buffer + encoder := json.NewEncoder(&buff) + encoder.SetIndent("", " ") + if err := encoder.Encode(unifiedDiff); err != nil { + t.Fatalf("Failed to encode unified diff: %v", err) + } + return buff.Bytes() + } + + t.Run("DefaultContextLines", func(t *testing.T) { + unifiedDiff := toUnifiedDiff(t, before, after, udiff.DefaultContextLines) + + t.Run("Content", func(t *testing.T) { + golden.RequireEqual(t, []byte(unifiedDiff.String())) + }) + t.Run("JSON", func(t *testing.T) { + golden.RequireEqual(t, toJSON(t, unifiedDiff)) + }) + }) + + t.Run("DefaultContextLinesPlusOne", func(t *testing.T) { + unifiedDiff := toUnifiedDiff(t, before, after, udiff.DefaultContextLines+1) + + t.Run("Content", func(t *testing.T) { + golden.RequireEqual(t, []byte(unifiedDiff.String())) + }) + t.Run("JSON", func(t *testing.T) { + golden.RequireEqual(t, toJSON(t, unifiedDiff)) + }) + }) + + t.Run("DefaultContextLinesPlusTwo", func(t *testing.T) { + unifiedDiff := toUnifiedDiff(t, before, after, udiff.DefaultContextLines+2) + + t.Run("Content", func(t *testing.T) { + golden.RequireEqual(t, []byte(unifiedDiff.String())) + }) + t.Run("JSON", func(t *testing.T) { + golden.RequireEqual(t, toJSON(t, unifiedDiff)) + }) + }) + }) +} diff --git a/internal/exp/diffview/util.go b/internal/exp/diffview/util.go new file mode 100644 index 0000000000000000000000000000000000000000..0ab35b16a5b9fb877b823784d8a4393a2ce4f650 --- /dev/null +++ b/internal/exp/diffview/util.go @@ -0,0 +1,39 @@ +package diffview + +import ( + "fmt" + "strings" + + "github.com/charmbracelet/x/ansi" +) + +func pad(v any, width int) string { + s := fmt.Sprintf("%v", v) + w := ansi.StringWidth(s) + if w >= width { + return s + } + return strings.Repeat(" ", width-w) + s +} + +func isEven(n int) bool { + return n%2 == 0 +} + +func isOdd(n int) bool { + return !isEven(n) +} + +func btoi(b bool) int { + if b { + return 1 + } + return 0 +} + +func ternary[T any](cond bool, t, f T) T { + if cond { + return t + } + return f +} diff --git a/internal/exp/diffview/util_test.go b/internal/exp/diffview/util_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3bba5070773a98c99a010722d0019fa48f45db43 --- /dev/null +++ b/internal/exp/diffview/util_test.go @@ -0,0 +1,27 @@ +package diffview + +import ( + "testing" +) + +func TestPad(t *testing.T) { + tests := []struct { + input any + width int + expected string + }{ + {7, 2, " 7"}, + {7, 3, " 7"}, + {"a", 2, " a"}, + {"a", 3, " a"}, + {"…", 2, " …"}, + {"…", 3, " …"}, + } + + for _, tt := range tests { + result := pad(tt.input, tt.width) + if result != tt.expected { + t.Errorf("expected %q, got %q", tt.expected, result) + } + } +} diff --git a/internal/fileutil/fileutil.go b/internal/fileutil/fileutil.go index 92fc9d39c585f7784c7fe8ca21a0cf8d6958cbcb..4955c0811d586a4035808d9813a35b3c7c2f8d10 100644 --- a/internal/fileutil/fileutil.go +++ b/internal/fileutil/fileutil.go @@ -211,3 +211,27 @@ func PrettyPath(path string) string { } return path } + +func DirTrim(pwd string, lim int) string { + var ( + out string + sep = string(filepath.Separator) + ) + dirs := strings.Split(pwd, sep) + if lim > len(dirs)-1 || lim <= 0 { + return pwd + } + for i := len(dirs) - 1; i > 0; i-- { + out = sep + out + if i == len(dirs)-1 { + out = dirs[i] + } else if i >= len(dirs)-lim { + out = string(dirs[i][0]) + out + } else { + out = "..." + out + break + } + } + out = filepath.Join("~", out) + return out +} diff --git a/internal/llm/agent/tools.go b/internal/llm/agent/tools.go index 763f53ea6f2246f2acae3f8c2907abf8be34a1d0..0fe2c530ca6dc30916fd2dfa094ad6303bf39443 100644 --- a/internal/llm/agent/tools.go +++ b/internal/llm/agent/tools.go @@ -33,7 +33,6 @@ func CoderAgentTools( tools.NewLsTool(), tools.NewSourcegraphTool(), tools.NewViewTool(lspClients), - tools.NewPatchTool(lspClients, permissions, history), tools.NewWriteTool(lspClients, permissions, history), NewAgentTool(sessions, messages, lspClients), }, otherTools..., diff --git a/internal/llm/tools/edit.go b/internal/llm/tools/edit.go index 2411187c1b5e6b93cc9f7fff4cdfa4b2014bbca8..fdbf4042528cfe8e2e213860203a16cb5d82ecf5 100644 --- a/internal/llm/tools/edit.go +++ b/internal/llm/tools/edit.go @@ -24,14 +24,16 @@ type EditParams struct { } type EditPermissionsParams struct { - FilePath string `json:"file_path"` - Diff string `json:"diff"` + FilePath string `json:"file_path"` + OldContent string `json:"old_content,omitempty"` + NewContent string `json:"new_content,omitempty"` } type EditResponseMetadata struct { - Diff string `json:"diff"` - Additions int `json:"additions"` - Removals int `json:"removals"` + Additions int `json:"additions"` + Removals int `json:"removals"` + OldContent string `json:"old_content,omitempty"` + NewContent string `json:"new_content,omitempty"` } type editTool struct { @@ -191,7 +193,7 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string) return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file") } - diff, additions, removals := diff.GenerateDiff( + _, additions, removals := diff.GenerateDiff( "", content, filePath, @@ -209,8 +211,9 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string) Action: "write", Description: fmt.Sprintf("Create file %s", filePath), Params: EditPermissionsParams{ - FilePath: filePath, - Diff: diff, + FilePath: filePath, + OldContent: "", + NewContent: content, }, }, ) @@ -243,9 +246,10 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string) return WithResponseMetadata( NewTextResponse("File created: "+filePath), EditResponseMetadata{ - Diff: diff, - Additions: additions, - Removals: removals, + OldContent: "", + NewContent: content, + Additions: additions, + Removals: removals, }, ), nil } @@ -301,7 +305,7 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file") } - diff, additions, removals := diff.GenerateDiff( + _, additions, removals := diff.GenerateDiff( oldContent, newContent, filePath, @@ -320,8 +324,9 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string Action: "write", Description: fmt.Sprintf("Delete content from file %s", filePath), Params: EditPermissionsParams{ - FilePath: filePath, - Diff: diff, + FilePath: filePath, + OldContent: oldContent, + NewContent: newContent, }, }, ) @@ -362,9 +367,10 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string return WithResponseMetadata( NewTextResponse("Content deleted from file: "+filePath), EditResponseMetadata{ - Diff: diff, - Additions: additions, - Removals: removals, + OldContent: oldContent, + NewContent: newContent, + Additions: additions, + Removals: removals, }, ), nil } @@ -422,7 +428,7 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS if sessionID == "" || messageID == "" { return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file") } - diff, additions, removals := diff.GenerateDiff( + _, additions, removals := diff.GenerateDiff( oldContent, newContent, filePath, @@ -440,8 +446,9 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS Action: "write", Description: fmt.Sprintf("Replace content in file %s", filePath), Params: EditPermissionsParams{ - FilePath: filePath, - Diff: diff, + FilePath: filePath, + OldContent: oldContent, + NewContent: newContent, }, }, ) @@ -482,8 +489,9 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS return WithResponseMetadata( NewTextResponse("Content replaced in file: "+filePath), EditResponseMetadata{ - Diff: diff, - Additions: additions, - Removals: removals, + OldContent: oldContent, + NewContent: newContent, + Additions: additions, + Removals: removals, }), nil } diff --git a/internal/llm/tools/fetch.go b/internal/llm/tools/fetch.go index 780f22a43bae7c9ec1e077c2d5878d3aeb0284ec..7acf23bae61df88792dd805317bdf8a67095dd0d 100644 --- a/internal/llm/tools/fetch.go +++ b/internal/llm/tools/fetch.go @@ -69,6 +69,11 @@ func NewFetchTool(permissions permission.Service) BaseTool { return &fetchTool{ client: &http.Client{ Timeout: 30 * time.Second, + Transport: &http.Transport{ + MaxIdleConns: 100, + MaxIdleConnsPerHost: 10, + IdleConnTimeout: 90 * time.Second, + }, }, permissions: permissions, } @@ -136,25 +141,26 @@ func (t *fetchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error return ToolResponse{}, permission.ErrorPermissionDenied } - client := t.client + // Handle timeout with context + requestCtx := ctx if params.Timeout > 0 { maxTimeout := 120 // 2 minutes if params.Timeout > maxTimeout { params.Timeout = maxTimeout } - client = &http.Client{ - Timeout: time.Duration(params.Timeout) * time.Second, - } + var cancel context.CancelFunc + requestCtx, cancel = context.WithTimeout(ctx, time.Duration(params.Timeout)*time.Second) + defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", params.URL, nil) + req, err := http.NewRequestWithContext(requestCtx, "GET", params.URL, nil) if err != nil { return ToolResponse{}, fmt.Errorf("failed to create request: %w", err) } req.Header.Set("User-Agent", "crush/1.0") - resp, err := client.Do(req) + resp, err := t.client.Do(req) if err != nil { return ToolResponse{}, fmt.Errorf("failed to fetch URL: %w", err) } diff --git a/internal/llm/tools/grep.go b/internal/llm/tools/grep.go index e6992a4f8c23dc440898298d8f0e5d880b2fdc53..3064ee633cf0e54bfb9d14efdd475cda15a38c85 100644 --- a/internal/llm/tools/grep.go +++ b/internal/llm/tools/grep.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "io" "os" "os/exec" "path/filepath" @@ -377,6 +378,11 @@ func searchFilesWithRegex(pattern, rootPath, include string) ([]grepMatch, error } func fileContainsPattern(filePath string, pattern *regexp.Regexp) (bool, int, string, error) { + // Quick binary file detection + if isBinaryFile(filePath) { + return false, 0, "", nil + } + file, err := os.Open(filePath) if err != nil { return false, 0, "", err @@ -396,6 +402,47 @@ func fileContainsPattern(filePath string, pattern *regexp.Regexp) (bool, int, st return false, 0, "", scanner.Err() } +var binaryExts = map[string]struct{}{ + ".exe": {}, ".dll": {}, ".so": {}, ".dylib": {}, + ".bin": {}, ".obj": {}, ".o": {}, ".a": {}, + ".zip": {}, ".tar": {}, ".gz": {}, ".bz2": {}, + ".jpg": {}, ".jpeg": {}, ".png": {}, ".gif": {}, + ".pdf": {}, ".doc": {}, ".docx": {}, ".xls": {}, + ".mp3": {}, ".mp4": {}, ".avi": {}, ".mov": {}, +} + +// isBinaryFile performs a quick check to determine if a file is binary +func isBinaryFile(filePath string) bool { + // Check file extension first (fastest) + ext := strings.ToLower(filepath.Ext(filePath)) + if _, isBinary := binaryExts[ext]; isBinary { + return true + } + + // Quick content check for files without clear extensions + file, err := os.Open(filePath) + if err != nil { + return false // If we can't open it, let the caller handle the error + } + defer file.Close() + + // Read first 512 bytes to check for null bytes + buffer := make([]byte, 512) + n, err := file.Read(buffer) + if err != nil && err != io.EOF { + return false + } + + // Check for null bytes (common in binary files) + for i := range n { + if buffer[i] == 0 { + return true + } + } + + return false +} + func globToRegex(glob string) string { regexPattern := strings.ReplaceAll(glob, ".", "\\.") regexPattern = strings.ReplaceAll(regexPattern, "*", ".*") diff --git a/internal/llm/tools/patch.go b/internal/llm/tools/patch.go deleted file mode 100644 index f66017e25cd647190421eda40c5628b24bd1b58c..0000000000000000000000000000000000000000 --- a/internal/llm/tools/patch.go +++ /dev/null @@ -1,372 +0,0 @@ -package tools - -import ( - "context" - "encoding/json" - "fmt" - "os" - "path/filepath" - "time" - - "github.com/charmbracelet/crush/internal/config" - "github.com/charmbracelet/crush/internal/diff" - "github.com/charmbracelet/crush/internal/history" - "github.com/charmbracelet/crush/internal/logging" - "github.com/charmbracelet/crush/internal/lsp" - "github.com/charmbracelet/crush/internal/permission" -) - -type PatchParams struct { - PatchText string `json:"patch_text"` -} - -type PatchResponseMetadata struct { - FilesChanged []string `json:"files_changed"` - Additions int `json:"additions"` - Removals int `json:"removals"` -} - -type patchTool struct { - lspClients map[string]*lsp.Client - permissions permission.Service - files history.Service -} - -const ( - PatchToolName = "patch" - patchDescription = `Applies a patch to multiple files in one operation. This tool is useful for making coordinated changes across multiple files. - -The patch text must follow this format: -*** Begin Patch -*** Update File: /path/to/file -@@ Context line (unique within the file) - Line to keep --Line to remove -+Line to add - Line to keep -*** Add File: /path/to/new/file -+Content of the new file -+More content -*** Delete File: /path/to/file/to/delete -*** End Patch - -Before using this tool: -1. Use the FileRead tool to understand the files' contents and context -2. Verify all file paths are correct (use the LS tool) - -CRITICAL REQUIREMENTS FOR USING THIS TOOL: - -1. UNIQUENESS: Context lines MUST uniquely identify the specific sections you want to change -2. PRECISION: All whitespace, indentation, and surrounding code must match exactly -3. VALIDATION: Ensure edits result in idiomatic, correct code -4. PATHS: Always use absolute file paths (starting with /) - -The tool will apply all changes in a single atomic operation.` -) - -func NewPatchTool(lspClients map[string]*lsp.Client, permissions permission.Service, files history.Service) BaseTool { - return &patchTool{ - lspClients: lspClients, - permissions: permissions, - files: files, - } -} - -func (p *patchTool) Info() ToolInfo { - return ToolInfo{ - Name: PatchToolName, - Description: patchDescription, - Parameters: map[string]any{ - "patch_text": map[string]any{ - "type": "string", - "description": "The full patch text that describes all changes to be made", - }, - }, - Required: []string{"patch_text"}, - } -} - -func (p *patchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error) { - var params PatchParams - if err := json.Unmarshal([]byte(call.Input), ¶ms); err != nil { - return NewTextErrorResponse("invalid parameters"), nil - } - - if params.PatchText == "" { - return NewTextErrorResponse("patch_text is required"), nil - } - - // Identify all files needed for the patch and verify they've been read - filesToRead := diff.IdentifyFilesNeeded(params.PatchText) - for _, filePath := range filesToRead { - absPath := filePath - if !filepath.IsAbs(absPath) { - wd := config.WorkingDirectory() - absPath = filepath.Join(wd, absPath) - } - - if getLastReadTime(absPath).IsZero() { - return NewTextErrorResponse(fmt.Sprintf("you must read the file %s before patching it. Use the FileRead tool first", filePath)), nil - } - - fileInfo, err := os.Stat(absPath) - if err != nil { - if os.IsNotExist(err) { - return NewTextErrorResponse(fmt.Sprintf("file not found: %s", absPath)), nil - } - return ToolResponse{}, fmt.Errorf("failed to access file: %w", err) - } - - if fileInfo.IsDir() { - return NewTextErrorResponse(fmt.Sprintf("path is a directory, not a file: %s", absPath)), nil - } - - modTime := fileInfo.ModTime() - lastRead := getLastReadTime(absPath) - if modTime.After(lastRead) { - return NewTextErrorResponse( - fmt.Sprintf("file %s has been modified since it was last read (mod time: %s, last read: %s)", - absPath, modTime.Format(time.RFC3339), lastRead.Format(time.RFC3339), - )), nil - } - } - - // Check for new files to ensure they don't already exist - filesToAdd := diff.IdentifyFilesAdded(params.PatchText) - for _, filePath := range filesToAdd { - absPath := filePath - if !filepath.IsAbs(absPath) { - wd := config.WorkingDirectory() - absPath = filepath.Join(wd, absPath) - } - - _, err := os.Stat(absPath) - if err == nil { - return NewTextErrorResponse(fmt.Sprintf("file already exists and cannot be added: %s", absPath)), nil - } else if !os.IsNotExist(err) { - return ToolResponse{}, fmt.Errorf("failed to check file: %w", err) - } - } - - // Load all required files - currentFiles := make(map[string]string) - for _, filePath := range filesToRead { - absPath := filePath - if !filepath.IsAbs(absPath) { - wd := config.WorkingDirectory() - absPath = filepath.Join(wd, absPath) - } - - content, err := os.ReadFile(absPath) - if err != nil { - return ToolResponse{}, fmt.Errorf("failed to read file %s: %w", absPath, err) - } - currentFiles[filePath] = string(content) - } - - // Process the patch - patch, fuzz, err := diff.TextToPatch(params.PatchText, currentFiles) - if err != nil { - return NewTextErrorResponse(fmt.Sprintf("failed to parse patch: %s", err)), nil - } - - if fuzz > 3 { - return NewTextErrorResponse(fmt.Sprintf("patch contains fuzzy matches (fuzz level: %d). Please make your context lines more precise", fuzz)), nil - } - - // Convert patch to commit - commit, err := diff.PatchToCommit(patch, currentFiles) - if err != nil { - return NewTextErrorResponse(fmt.Sprintf("failed to create commit from patch: %s", err)), nil - } - - // Get session ID and message ID - sessionID, messageID := GetContextValues(ctx) - if sessionID == "" || messageID == "" { - return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a patch") - } - - // Request permission for all changes - for path, change := range commit.Changes { - switch change.Type { - case diff.ActionAdd: - dir := filepath.Dir(path) - patchDiff, _, _ := diff.GenerateDiff("", *change.NewContent, path) - p := p.permissions.Request( - permission.CreatePermissionRequest{ - SessionID: sessionID, - Path: dir, - ToolName: PatchToolName, - Action: "create", - Description: fmt.Sprintf("Create file %s", path), - Params: EditPermissionsParams{ - FilePath: path, - Diff: patchDiff, - }, - }, - ) - if !p { - return ToolResponse{}, permission.ErrorPermissionDenied - } - case diff.ActionUpdate: - currentContent := "" - if change.OldContent != nil { - currentContent = *change.OldContent - } - newContent := "" - if change.NewContent != nil { - newContent = *change.NewContent - } - patchDiff, _, _ := diff.GenerateDiff(currentContent, newContent, path) - dir := filepath.Dir(path) - p := p.permissions.Request( - permission.CreatePermissionRequest{ - SessionID: sessionID, - Path: dir, - ToolName: PatchToolName, - Action: "update", - Description: fmt.Sprintf("Update file %s", path), - Params: EditPermissionsParams{ - FilePath: path, - Diff: patchDiff, - }, - }, - ) - if !p { - return ToolResponse{}, permission.ErrorPermissionDenied - } - case diff.ActionDelete: - dir := filepath.Dir(path) - patchDiff, _, _ := diff.GenerateDiff(*change.OldContent, "", path) - p := p.permissions.Request( - permission.CreatePermissionRequest{ - SessionID: sessionID, - Path: dir, - ToolName: PatchToolName, - Action: "delete", - Description: fmt.Sprintf("Delete file %s", path), - Params: EditPermissionsParams{ - FilePath: path, - Diff: patchDiff, - }, - }, - ) - if !p { - return ToolResponse{}, permission.ErrorPermissionDenied - } - } - } - - // Apply the changes to the filesystem - err = diff.ApplyCommit(commit, func(path string, content string) error { - absPath := path - if !filepath.IsAbs(absPath) { - wd := config.WorkingDirectory() - absPath = filepath.Join(wd, absPath) - } - - // Create parent directories if needed - dir := filepath.Dir(absPath) - if err := os.MkdirAll(dir, 0o755); err != nil { - return fmt.Errorf("failed to create parent directories for %s: %w", absPath, err) - } - - return os.WriteFile(absPath, []byte(content), 0o644) - }, func(path string) error { - absPath := path - if !filepath.IsAbs(absPath) { - wd := config.WorkingDirectory() - absPath = filepath.Join(wd, absPath) - } - return os.Remove(absPath) - }) - if err != nil { - return NewTextErrorResponse(fmt.Sprintf("failed to apply patch: %s", err)), nil - } - - // Update file history for all modified files - changedFiles := []string{} - totalAdditions := 0 - totalRemovals := 0 - - for path, change := range commit.Changes { - absPath := path - if !filepath.IsAbs(absPath) { - wd := config.WorkingDirectory() - absPath = filepath.Join(wd, absPath) - } - changedFiles = append(changedFiles, absPath) - - oldContent := "" - if change.OldContent != nil { - oldContent = *change.OldContent - } - - newContent := "" - if change.NewContent != nil { - newContent = *change.NewContent - } - - // Calculate diff statistics - _, additions, removals := diff.GenerateDiff(oldContent, newContent, path) - totalAdditions += additions - totalRemovals += removals - - // Update history - file, err := p.files.GetByPathAndSession(ctx, absPath, sessionID) - if err != nil && change.Type != diff.ActionAdd { - // If not adding a file, create history entry for existing file - _, err = p.files.Create(ctx, sessionID, absPath, oldContent) - if err != nil { - logging.Debug("Error creating file history", "error", err) - } - } - - if err == nil && change.Type != diff.ActionAdd && file.Content != oldContent { - // User manually changed content, store intermediate version - _, err = p.files.CreateVersion(ctx, sessionID, absPath, oldContent) - if err != nil { - logging.Debug("Error creating file history version", "error", err) - } - } - - // Store new version - if change.Type == diff.ActionDelete { - _, err = p.files.CreateVersion(ctx, sessionID, absPath, "") - } else { - _, err = p.files.CreateVersion(ctx, sessionID, absPath, newContent) - } - if err != nil { - logging.Debug("Error creating file history version", "error", err) - } - - // Record file operations - recordFileWrite(absPath) - recordFileRead(absPath) - } - - // Run LSP diagnostics on all changed files - for _, filePath := range changedFiles { - waitForLspDiagnostics(ctx, filePath, p.lspClients) - } - - result := fmt.Sprintf("Patch applied successfully. %d files changed, %d additions, %d removals", - len(changedFiles), totalAdditions, totalRemovals) - - diagnosticsText := "" - for _, filePath := range changedFiles { - diagnosticsText += getDiagnostics(filePath, p.lspClients) - } - - if diagnosticsText != "" { - result += "\n\nDiagnostics:\n" + diagnosticsText - } - - return WithResponseMetadata( - NewTextResponse(result), - PatchResponseMetadata{ - FilesChanged: changedFiles, - Additions: totalAdditions, - Removals: totalRemovals, - }), nil -} diff --git a/internal/llm/tools/shell/comparison_test.go b/internal/llm/tools/shell/comparison_test.go index 7fcd720b5ecdfba236ed7316dfc26b63d5ff9605..7cfe28034bb5d53148cfef0f4815dd685dd597e4 100644 --- a/internal/llm/tools/shell/comparison_test.go +++ b/internal/llm/tools/shell/comparison_test.go @@ -3,7 +3,6 @@ package shell import ( "context" "os" - "runtime" "testing" "time" @@ -32,34 +31,6 @@ func TestShellPerformanceComparison(t *testing.T) { t.Logf("Quick command took: %v", duration) } -func TestShellCPUUsageComparison(t *testing.T) { - tmpDir, err := os.MkdirTemp("", "shell-test") - require.NoError(t, err) - defer os.RemoveAll(tmpDir) - - shell := GetPersistentShell(tmpDir) - defer shell.Close() - - // Measure CPU and memory usage during a longer command - var m1, m2 runtime.MemStats - runtime.GC() - runtime.ReadMemStats(&m1) - - start := time.Now() - _, stderr, exitCode, _, err := shell.Exec(context.Background(), "sleep 0.1", 1000) - duration := time.Since(start) - - runtime.ReadMemStats(&m2) - - require.NoError(t, err) - assert.Equal(t, 0, exitCode) - assert.Empty(t, stderr) - - memGrowth := m2.Alloc - m1.Alloc - t.Logf("Sleep 0.1s command took: %v", duration) - t.Logf("Memory growth during polling: %d bytes", memGrowth) - t.Logf("GC cycles during test: %d", m2.NumGC-m1.NumGC) -} // Benchmark CPU usage during polling func BenchmarkShellPolling(b *testing.B) { diff --git a/internal/llm/tools/shell/shell_test.go b/internal/llm/tools/shell/shell_test.go index 327ec91db5f2cdffdbb501648df1546e4746fabb..48198426e06ec2ade627bd6f24db0d02ad005b0f 100644 --- a/internal/llm/tools/shell/shell_test.go +++ b/internal/llm/tools/shell/shell_test.go @@ -4,35 +4,10 @@ import ( "context" "os" "testing" - "time" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -func TestShellPerformanceImprovement(t *testing.T) { - // Create a temporary directory for the shell - tmpDir, err := os.MkdirTemp("", "shell-test") - require.NoError(t, err) - defer os.RemoveAll(tmpDir) - - shell := GetPersistentShell(tmpDir) - defer shell.Close() - - // Test that quick commands complete fast - start := time.Now() - stdout, stderr, exitCode, _, err := shell.Exec(context.Background(), "echo 'hello world'", 0) - duration := time.Since(start) - - require.NoError(t, err) - assert.Equal(t, 0, exitCode) - assert.Contains(t, stdout, "hello world") - assert.Empty(t, stderr) - - // Quick commands should complete very fast with our exponential backoff - assert.Less(t, duration, 50*time.Millisecond, "Quick command should complete fast with exponential backoff") -} - // Benchmark to measure CPU efficiency func BenchmarkShellQuickCommands(b *testing.B) { tmpDir, err := os.MkdirTemp("", "shell-bench") diff --git a/internal/llm/tools/sourcegraph.go b/internal/llm/tools/sourcegraph.go index f62e6a961bed962088e0e40670a4276f16174187..29518b7b818da5746d195ea8b7da521d80429962 100644 --- a/internal/llm/tools/sourcegraph.go +++ b/internal/llm/tools/sourcegraph.go @@ -129,6 +129,11 @@ func NewSourcegraphTool() BaseTool { return &sourcegraphTool{ client: &http.Client{ Timeout: 30 * time.Second, + Transport: &http.Transport{ + MaxIdleConns: 100, + MaxIdleConnsPerHost: 10, + IdleConnTimeout: 90 * time.Second, + }, }, } } @@ -178,15 +183,17 @@ func (t *sourcegraphTool) Run(ctx context.Context, call ToolCall) (ToolResponse, if params.ContextWindow <= 0 { params.ContextWindow = 10 // Default context window } - client := t.client + + // Handle timeout with context + requestCtx := ctx if params.Timeout > 0 { maxTimeout := 120 // 2 minutes if params.Timeout > maxTimeout { params.Timeout = maxTimeout } - client = &http.Client{ - Timeout: time.Duration(params.Timeout) * time.Second, - } + var cancel context.CancelFunc + requestCtx, cancel = context.WithTimeout(ctx, time.Duration(params.Timeout)*time.Second) + defer cancel() } type graphqlRequest struct { @@ -208,7 +215,7 @@ func (t *sourcegraphTool) Run(ctx context.Context, call ToolCall) (ToolResponse, graphqlQuery := string(graphqlQueryBytes) req, err := http.NewRequestWithContext( - ctx, + requestCtx, "POST", "https://sourcegraph.com/.api/graphql", bytes.NewBuffer([]byte(graphqlQuery)), @@ -220,7 +227,7 @@ func (t *sourcegraphTool) Run(ctx context.Context, call ToolCall) (ToolResponse, req.Header.Set("Content-Type", "application/json") req.Header.Set("User-Agent", "crush/1.0") - resp, err := client.Do(req) + resp, err := t.client.Do(req) if err != nil { return ToolResponse{}, fmt.Errorf("failed to fetch URL: %w", err) } diff --git a/internal/lsp/watcher/watcher.go b/internal/lsp/watcher/watcher.go index 3b8c36d963b88c1c4b60ef23a5c7cd9c26af4025..4db10e5b7163468f9d45b307be493a70028381b5 100644 --- a/internal/lsp/watcher/watcher.go +++ b/internal/lsp/watcher/watcher.go @@ -257,7 +257,10 @@ func (w *WorkspaceWatcher) openHighPriorityFiles(ctx context.Context, serverName } } - // For each pattern, find and open matching files + // Collect all files to open first + var filesToOpen []string + + // For each pattern, find matching files for _, pattern := range patterns { // Use doublestar.Glob to find files matching the pattern (supports ** patterns) matches, err := doublestar.Glob(os.DirFS(w.workspacePath), pattern) @@ -278,7 +281,23 @@ func (w *WorkspaceWatcher) openHighPriorityFiles(ctx context.Context, serverName continue } - // Open the file + filesToOpen = append(filesToOpen, fullPath) + + // Limit the number of files per pattern + if len(filesToOpen) >= 5 && (serverName != "java" && serverName != "jdtls") { + break + } + } + } + + // Open files in batches to reduce overhead + batchSize := 3 + for i := 0; i < len(filesToOpen); i += batchSize { + end := min(i+batchSize, len(filesToOpen)) + + // Open batch of files + for j := i; j < end; j++ { + fullPath := filesToOpen[j] if err := w.client.OpenFile(ctx, fullPath); err != nil { if cnf.DebugLSP { logging.Debug("Error opening high-priority file", "path", fullPath, "error", err) @@ -289,14 +308,11 @@ func (w *WorkspaceWatcher) openHighPriorityFiles(ctx context.Context, serverName logging.Debug("Opened high-priority file", "path", fullPath) } } + } - // Add a small delay to prevent overwhelming the server - time.Sleep(20 * time.Millisecond) - - // Limit the number of files opened per pattern - if filesOpened >= 5 && (serverName != "java" && serverName != "jdtls") { - break - } + // Only add delay between batches, not individual files + if end < len(filesToOpen) { + time.Sleep(50 * time.Millisecond) } } diff --git a/internal/tui/components/chat/messages/renderer.go b/internal/tui/components/chat/messages/renderer.go index 339aa51b299d368a5d8f3c31b0c10d6d00a8a784..d63201fe17fe2841b3d2ee77c63edc8bbef0e34f 100644 --- a/internal/tui/components/chat/messages/renderer.go +++ b/internal/tui/components/chat/messages/renderer.go @@ -6,11 +6,11 @@ import ( "strings" "time" - "github.com/charmbracelet/crush/internal/diff" "github.com/charmbracelet/crush/internal/fileutil" "github.com/charmbracelet/crush/internal/highlight" "github.com/charmbracelet/crush/internal/llm/agent" "github.com/charmbracelet/crush/internal/llm/tools" + "github.com/charmbracelet/crush/internal/tui/components/core" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/lipgloss/v2" "github.com/charmbracelet/lipgloss/v2/tree" @@ -148,7 +148,6 @@ func init() { registry.register(tools.GrepToolName, func() renderer { return grepRenderer{} }) registry.register(tools.LSToolName, func() renderer { return lsRenderer{} }) registry.register(tools.SourcegraphToolName, func() renderer { return sourcegraphRenderer{} }) - registry.register(tools.PatchToolName, func() renderer { return patchRenderer{} }) registry.register(tools.DiagnosticsToolName, func() renderer { return diagnosticsRenderer{} }) registry.register(agent.AgentToolName, func() renderer { return agentRenderer{} }) } @@ -258,9 +257,12 @@ func (er editRenderer) Render(v *toolCallCmp) string { return renderPlainContent(v, v.result.Content) } - trunc := truncateHeight(meta.Diff, responseContextHeight) - diffView, _ := diff.FormatDiff(trunc, diff.WithTotalWidth(v.textWidth()-2)) - return diffView + formatter := core.DiffFormatter(). + Before(fileutil.PrettyPath(params.FilePath), meta.OldContent). + After(fileutil.PrettyPath(params.FilePath), meta.NewContent). + Split(). + Width(v.textWidth() - 2) // -2 for padding + return formatter.String() }) } @@ -446,38 +448,6 @@ func (sr sourcegraphRenderer) Render(v *toolCallCmp) string { }) } -// ----------------------------------------------------------------------------- -// Patch renderer -// ----------------------------------------------------------------------------- - -// patchRenderer handles multi-file patches with change summaries -type patchRenderer struct { - baseRenderer -} - -// Render displays patch summary with file count and change statistics -func (pr patchRenderer) Render(v *toolCallCmp) string { - var params tools.PatchParams - if err := pr.unmarshalParams(v.call.Input, ¶ms); err != nil { - return pr.renderError(v, "Invalid patch parameters") - } - - args := newParamBuilder().addMain("multiple files").build() - - return pr.renderWithParams(v, "Patch", args, func() string { - var meta tools.PatchResponseMetadata - if err := pr.unmarshalParams(v.result.Metadata, &meta); err != nil { - return renderPlainContent(v, v.result.Content) - } - - summary := fmt.Sprintf("Changed %d files (%d+ %d-)", - len(meta.FilesChanged), meta.Additions, meta.Removals) - filesList := strings.Join(meta.FilesChanged, "\n") - - return renderPlainContent(v, summary+"\n\n"+filesList) - }) -} - // ----------------------------------------------------------------------------- // Diagnostics renderer // ----------------------------------------------------------------------------- @@ -711,8 +681,6 @@ func prettifyToolName(name string) string { return "View" case tools.WriteToolName: return "Write" - case tools.PatchToolName: - return "Patch" default: return name } diff --git a/internal/tui/components/chat/sidebar/sidebar.go b/internal/tui/components/chat/sidebar/sidebar.go index 9ed5c9a28a4fe65f8b23338ea259e82e5e6ef2f9..6b111a887d747ccd6634256d5b06e6f89d36d811 100644 --- a/internal/tui/components/chat/sidebar/sidebar.go +++ b/internal/tui/components/chat/sidebar/sidebar.go @@ -1,12 +1,16 @@ package sidebar import ( + "context" "fmt" "os" "strings" tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/config" + "github.com/charmbracelet/crush/internal/diff" + "github.com/charmbracelet/crush/internal/fileutil" + "github.com/charmbracelet/crush/internal/history" "github.com/charmbracelet/crush/internal/llm/models" "github.com/charmbracelet/crush/internal/logging" "github.com/charmbracelet/crush/internal/lsp" @@ -21,12 +25,22 @@ import ( "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/crush/internal/version" "github.com/charmbracelet/lipgloss/v2" + "github.com/charmbracelet/x/ansi" ) const ( logoBreakpoint = 65 ) +type SessionFile struct { + FilePath string + Additions int + Deletions int +} +type SessionFilesMsg struct { + Files []SessionFile +} + type Sidebar interface { util.Model layout.Sizeable @@ -38,11 +52,14 @@ type sidebarCmp struct { logo string cwd string lspClients map[string]*lsp.Client + history history.Service + files []SessionFile } -func NewSidebarCmp(lspClients map[string]*lsp.Client) Sidebar { +func NewSidebarCmp(history history.Service, lspClients map[string]*lsp.Client) Sidebar { return &sidebarCmp{ lspClients: lspClients, + history: history, } } @@ -58,6 +75,12 @@ func (m *sidebarCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if msg.ID != m.session.ID { m.session = msg } + return m, m.loadSessionFiles + case SessionFilesMsg: + m.files = msg.Files + logging.Info("Loaded session files", "count", len(m.files)) + return m, nil + case chat.SessionClearedMsg: m.session = session.Session{} case pubsub.Event[session.Session]: @@ -85,6 +108,8 @@ func (m *sidebarCmp) View() tea.View { "", m.currentModelBlock(), "", + m.filesBlock(), + "", m.lspBlock(), "", m.mcpBlock(), @@ -95,6 +120,58 @@ func (m *sidebarCmp) View() tea.View { ) } +func (m *sidebarCmp) loadSessionFiles() tea.Msg { + files, err := m.history.ListBySession(context.Background(), m.session.ID) + if err != nil { + return util.InfoMsg{ + Type: util.InfoTypeError, + Msg: err.Error(), + } + } + + type fileHistory struct { + initialVersion history.File + latestVersion history.File + } + + fileMap := make(map[string]fileHistory) + + for _, file := range files { + if existing, ok := fileMap[file.Path]; ok { + // Update the latest version + if existing.latestVersion.CreatedAt < file.CreatedAt { + existing.latestVersion = file + } + if file.Version == history.InitialVersion { + existing.initialVersion = file + } + fileMap[file.Path] = existing + } else { + // Add the initial version + fileMap[file.Path] = fileHistory{ + initialVersion: file, + latestVersion: file, + } + } + } + + sessionFiles := make([]SessionFile, 0, len(fileMap)) + for path, fh := range fileMap { + if fh.initialVersion.Version == history.InitialVersion { + _, additions, deletions := diff.GenerateDiff(fh.initialVersion.Content, fh.latestVersion.Content, fh.initialVersion.Path) + sessionFiles = append(sessionFiles, SessionFile{ + FilePath: path, + Additions: additions, + Deletions: deletions, + }) + } + } + + return SessionFilesMsg{ + Files: sessionFiles, + } +} + func (m *sidebarCmp) SetSize(width, height int) tea.Cmd { if width < logoBreakpoint && m.width >= logoBreakpoint { m.logo = m.logoBlock(true) @@ -122,11 +199,64 @@ func (m *sidebarCmp) logoBlock(compact bool) string { }) } +func (m *sidebarCmp) filesBlock() string { + maxWidth := min(m.width, 58) + t := styles.CurrentTheme() + + section := t.S().Subtle.Render( + core.Section("Modified Files", maxWidth), + ) + + if len(m.files) == 0 { + return lipgloss.JoinVertical( + lipgloss.Left, + section, + "", + t.S().Base.Foreground(t.Border).Render("None"), + ) + } + + fileList := []string{section, ""} + + for _, file := range m.files { + // Extract just the filename from the path + + // Create status indicators for additions/deletions + var statusParts []string + if file.Additions > 0 { + statusParts = append(statusParts, t.S().Base.Foreground(t.Success).Render(fmt.Sprintf("+%d", file.Additions))) + } + if file.Deletions > 0 { + statusParts = append(statusParts, t.S().Base.Foreground(t.Error).Render(fmt.Sprintf("-%d", file.Deletions))) + } + + extraContent := strings.Join(statusParts, " ") + filePath := fileutil.DirTrim(fileutil.PrettyPath(file.FilePath), 2) + filePath = ansi.Truncate(filePath, maxWidth-lipgloss.Width(extraContent)-2, "…") + fileList = append(fileList, + core.Status( + core.StatusOpts{ + IconColor: t.FgMuted, + NoIcon: true, + Title: filePath, + ExtraContent: extraContent, + }, + m.width, + ), + ) + } + + return lipgloss.JoinVertical( + lipgloss.Left, + fileList..., + ) +} + func (m *sidebarCmp) lspBlock() string { maxWidth := min(m.width, 58) t := styles.CurrentTheme() - section := t.S().Muted.Render( + section := t.S().Subtle.Render( core.Section("LSPs", maxWidth), ) @@ -177,7 +307,6 @@ func (m *sidebarCmp) lspBlock() string { errs = append(errs, t.S().Base.Foreground(t.FgHalfMuted).Render(fmt.Sprintf("%s%d", styles.InfoIcon, lspErrs[protocol.SeverityInformation]))) } - logging.Info("LSP Errors", "errors", errs) lspList = append(lspList, core.Status( core.StatusOpts{ @@ -201,7 +330,7 @@ func (m *sidebarCmp) mcpBlock() string { maxWidth := min(m.width, 58) t := styles.CurrentTheme() - section := t.S().Muted.Render( + section := t.S().Subtle.Render( core.Section("MCPs", maxWidth), ) @@ -264,8 +393,8 @@ func formatTokensAndCost(tokens, contextWindow int64, cost float64) string { formattedCost := baseStyle.Foreground(t.FgMuted).Render(fmt.Sprintf("$%.2f", cost)) - formattedTokens = baseStyle.Foreground(t.FgMuted).Render(fmt.Sprintf("(%s)", formattedTokens)) - formattedPercentage := baseStyle.Foreground(t.FgSubtle).Render(fmt.Sprintf("%d%%", int(percentage))) + formattedTokens = baseStyle.Foreground(t.FgSubtle).Render(fmt.Sprintf("(%s)", formattedTokens)) + formattedPercentage := baseStyle.Foreground(t.FgMuted).Render(fmt.Sprintf("%d%%", int(percentage))) formattedTokens = fmt.Sprintf("%s %s", formattedPercentage, formattedTokens) if percentage > 80 { // add the warning icon @@ -287,8 +416,6 @@ func (s *sidebarCmp) currentModelBlock() string { modelName := t.S().Text.Render(model.Name) modelInfo := fmt.Sprintf("%s %s", modelIcon, modelName) parts := []string{ - // section, - // "", modelInfo, } if s.session.ID != "" { diff --git a/internal/tui/components/core/helpers.go b/internal/tui/components/core/helpers.go index 3621956393a8b73f5f35f659ad9d72ebe77c53aa..ee7340ea4f13eee4e4ac74789a9a6efcd7c4ad8b 100644 --- a/internal/tui/components/core/helpers.go +++ b/internal/tui/components/core/helpers.go @@ -4,6 +4,8 @@ import ( "image/color" "strings" + "github.com/alecthomas/chroma/v2" + "github.com/charmbracelet/crush/internal/exp/diffview" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/lipgloss/v2" "github.com/charmbracelet/x/ansi" @@ -38,6 +40,7 @@ func Title(title string, width int) string { type StatusOpts struct { Icon string IconColor color.Color + NoIcon bool // If true, no icon will be displayed Title string TitleColor color.Color Description string @@ -51,6 +54,8 @@ func Status(ops StatusOpts, width int) string { iconColor := t.Success if ops.Icon != "" { icon = ops.Icon + } else if ops.NoIcon { + icon = "" } if ops.IconColor != nil { iconColor = ops.IconColor @@ -65,7 +70,6 @@ func Status(ops StatusOpts, width int) string { if ops.DescriptionColor != nil { descriptionColor = ops.DescriptionColor } - icon = t.S().Base.Foreground(iconColor).Render(icon) title = t.S().Base.Foreground(titleColor).Render(title) if description != "" { extraContent := len(ops.ExtraContent) @@ -75,11 +79,12 @@ func Status(ops StatusOpts, width int) string { description = ansi.Truncate(description, width-lipgloss.Width(icon)-lipgloss.Width(title)-2-extraContent, "…") } description = t.S().Base.Foreground(descriptionColor).Render(description) - content := []string{ - icon, - title, - description, + + content := []string{} + if icon != "" { + content = append(content, t.S().Base.Foreground(iconColor).Render(icon)) } + content = append(content, title, description) if ops.ExtraContent != "" { content = append(content, ops.ExtraContent) } @@ -141,3 +146,12 @@ func SelectableButtons(buttons []ButtonOpts, spacing string) string { return lipgloss.JoinHorizontal(lipgloss.Left, parts...) } + +func DiffFormatter() *diffview.DiffView { + formatDiff := diffview.New() + style := chroma.MustNewStyle("crush", styles.GetChromaTheme()) + diff := formatDiff. + SyntaxHightlight(true). + ChromaStyle(style) + return diff +} diff --git a/internal/tui/components/dialogs/commands/commands.go b/internal/tui/components/dialogs/commands/commands.go index 7006117a33d916d0e822a2347b6b8993e99b7ddd..67f591b6bf3971826d8dffb0f8cc63d1bf1e57fd 100644 --- a/internal/tui/components/dialogs/commands/commands.go +++ b/internal/tui/components/dialogs/commands/commands.go @@ -239,7 +239,8 @@ func (c *commandDialogCmp) defaultCommands() []Command { The file you create will be given to agentic coding agents (such as yourself) that operate in this repository. Make it about 20 lines long. If there's already a CRUSH.md, improve it. - If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them.` + If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them. + Add the .crush directory to the .gitignore file if it's not already there.` return util.CmdHandler(chat.SendMsg{ Text: prompt, }) diff --git a/internal/tui/components/dialogs/init/init.go b/internal/tui/components/dialogs/init/init.go index 347dc643da559bcb53449ec22765d550cf8f400f..74d0dc0b3d9d4630b28c4b240fb17fbe611ba21f 100644 --- a/internal/tui/components/dialogs/init/init.go +++ b/internal/tui/components/dialogs/init/init.go @@ -180,7 +180,8 @@ func (m *initDialogCmp) handleInitialization(initialize bool) tea.Cmd { The file you create will be given to agentic coding agents (such as yourself) that operate in this repository. Make it about 20 lines long. If there's already a CRUSH.md, improve it. -If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them.` +If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them. +Add the .crush directory to the .gitignore file if it's not already there.` // Mark the project as initialized if err := config.MarkProjectInitialized(); err != nil { diff --git a/internal/tui/components/dialogs/permissions/permissions.go b/internal/tui/components/dialogs/permissions/permissions.go index 0e69eaccc89237bc6ca4bf7fe694a9f48b8d524c..f36c9ec085c0627174078ec589659b28c912e327 100644 --- a/internal/tui/components/dialogs/permissions/permissions.go +++ b/internal/tui/components/dialogs/permissions/permissions.go @@ -267,24 +267,13 @@ func (p *permissionDialogCmp) renderBashContent() string { func (p *permissionDialogCmp) renderEditContent() string { if pr, ok := p.permission.Params.(tools.EditPermissionsParams); ok { - diff := p.GetOrSetDiff(p.permission.ID, func() (string, error) { - return diff.FormatDiff(pr.Diff, diff.WithTotalWidth(p.contentViewPort.Width())) - }) - - contentHeight := min(p.height-9, lipgloss.Height(diff)) - p.contentViewPort.SetHeight(contentHeight) - p.contentViewPort.SetContent(diff) - return p.styleViewport() - } - return "" -} - -func (p *permissionDialogCmp) renderPatchContent() string { - if pr, ok := p.permission.Params.(tools.EditPermissionsParams); ok { - diff := p.GetOrSetDiff(p.permission.ID, func() (string, error) { - return diff.FormatDiff(pr.Diff, diff.WithTotalWidth(p.contentViewPort.Width())) - }) + formatter := core.DiffFormatter(). + Before(fileutil.PrettyPath(pr.FilePath), pr.OldContent). + After(fileutil.PrettyPath(pr.FilePath), pr.NewContent). + Width(p.contentViewPort.Width()). + Split() + diff := formatter.String() contentHeight := min(p.height-9, lipgloss.Height(diff)) p.contentViewPort.SetHeight(contentHeight) p.contentViewPort.SetContent(diff) @@ -381,8 +370,6 @@ func (p *permissionDialogCmp) render() string { contentFinal = p.renderBashContent() case tools.EditToolName: contentFinal = p.renderEditContent() - case tools.PatchToolName: - contentFinal = p.renderPatchContent() case tools.WriteToolName: contentFinal = p.renderWriteContent() case tools.FetchToolName: diff --git a/internal/tui/page/chat/chat.go b/internal/tui/page/chat/chat.go index 94fa4dd353043aaf76dbd44f7253574d72f4927d..179147cbb3b3b9025957a60b04b5fa557d9136c3 100644 --- a/internal/tui/page/chat/chat.go +++ b/internal/tui/page/chat/chat.go @@ -209,7 +209,7 @@ func (p *chatPage) Bindings() []key.Binding { func NewChatPage(app *app.App) ChatPage { sidebarContainer := layout.NewContainer( - sidebar.NewSidebarCmp(app.LSPClients), + sidebar.NewSidebarCmp(app.History, app.LSPClients), layout.WithPadding(1, 1, 1, 1), ) editorContainer := layout.NewContainer( diff --git a/todos.md b/todos.md index a1b8adb06e7fb997be154e9b80177d25a0449b33..2a9cb74fcdf93302d0eb823c9692cf8b2c22c7ca 100644 --- a/todos.md +++ b/todos.md @@ -27,6 +27,7 @@ - [ ] Update interactive mode to use the spinner - [ ] Revisit the core list component - [ ] This component has become super complex we might need to fix this. +- [ ] Handle correct LSP and MCP status icon - [ ] Investigate ways to make the spinner less CPU intensive - [ ] General cleanup and documentation - [ ] Update the readme