Skip to content

fix(viewport): leave lines that end inside a style to lipgloss - #27

Merged
cornedor merged 3 commits into
mainfrom
lipgloss-2.1
Nov 17, 2026
Merged

cornedor merged 3 commits into
mainfrom
lipgloss-2.1

Conversation

@cornedor

Copy link
Copy Markdown
Owner

Replaces #23: Dependabot's go group bump (lipgloss 2.1.0, x/sync 0.25.0, x/text 0.44.0, modernc sqlite 1.62.0, with its nix vendorHash) plus the fix its tests needed.

With a width set, lipgloss 2.1.0 closes a style a line leaves on (\x1b[m before the padding) and opens it again on the next line; an unterminated hyperlink gets closed too. padBlock, the viewport's fast path that promises lipgloss's exact bytes, only appended blanks, so TestPadBlockMatchesLipgloss failed on both OSes.

padBlock now leaves such a line to lipgloss: it takes the fast path only when the line's last SGR is a full reset and its last hyperlink is closed (leavesStyleOpen). Copying lipgloss's close-and-reopen rule instead would tie the fast path to its internals again; the panes look the same either way.

Tests: TestPadBlockMatchesLipgloss fails on #23 and passes here; it gained lines ending in a partial SGR reset, another CSI and an open and a closed hyperlink. go test ./internal/viewport passes. Not measured: padBlock has no benchmark; the check is two strings.LastIndex calls per line next to the width scan it already does.

dependabot Bot and others added 3 commits November 13, 2026 01:14
Bumps the go group with 4 updates: charm.land/lipgloss/v2, [golang.org/x/sync](https://github.com/golang/sync), [golang.org/x/text](https://github.com/golang/text) and [modernc.org/sqlite](https://gitlab.com/cznic/sqlite).


Updates `charm.land/lipgloss/v2` from 2.0.6 to 2.1.0

Updates `golang.org/x/sync` from 0.24.0 to 0.25.0
- [Commits](golang/sync@v0.24.0...v0.25.0)

Updates `golang.org/x/text` from 0.43.0 to 0.44.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](golang/text@v0.43.0...v0.44.0)

Updates `modernc.org/sqlite` from 1.61.1 to 1.62.0
- [Release notes](https://gitlab.com/cznic/sqlite/tags)
- [Changelog](https://gitlab.com/cznic/sqlite/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.61.1...v1.62.0)

---
updated-dependencies:
- dependency-name: charm.land/lipgloss/v2
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: golang.org/x/sync
  dependency-version: 0.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: golang.org/x/text
  dependency-version: 0.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: modernc.org/sqlite
  dependency-version: 1.62.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
...

Signed-off-by: dependabot[bot] <support@github.com>
@cornedor
cornedor merged commit a4c42a8 into main Nov 17, 2026
7 checks passed
@cornedor
cornedor deleted the lipgloss-2.1 branch November 17, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant