Skip to content

Commit 16257af

Browse files
authored
Merge pull request #392 from creatang/fix/tui-markdown-render-pollution
tui: 修复 Transcript 选区拖拽渲染与复制
2 parents 1c4a2cb + e6e3945 commit 16257af

8 files changed

Lines changed: 1003 additions & 30 deletions

File tree

internal/tui/core/app/app.go

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,19 @@ type appRuntimeState struct {
136136
logPersistVersion int
137137
transcriptContent string
138138
transcriptScrollbarDrag bool
139-
footerErrorLast string
140-
footerErrorText string
141-
footerErrorUntil time.Time
139+
140+
textSelection struct {
141+
active bool
142+
dragging bool
143+
startLine int
144+
startCol int
145+
endLine int
146+
endCol int
147+
}
148+
149+
footerErrorLast string
150+
footerErrorText string
151+
footerErrorUntil time.Time
142152
}
143153

144154
type pendingImageAttachment struct {
@@ -259,6 +269,23 @@ func newApp(container tuibootstrap.Container) (App, error) {
259269

260270
h := help.New()
261271
h.ShowAll = false
272+
h.ShortSeparator = " • "
273+
h.Styles.ShortKey = lipgloss.NewStyle().
274+
Foreground(lipgloss.Color(selectionFg)).
275+
Bold(true).
276+
Underline(true)
277+
h.Styles.ShortDesc = lipgloss.NewStyle().
278+
Foreground(lipgloss.Color(lightText)).
279+
Bold(true)
280+
h.Styles.ShortSeparator = lipgloss.NewStyle().
281+
Foreground(lipgloss.Color(coralAccent)).
282+
Bold(true)
283+
h.Styles.FullKey = h.Styles.ShortKey.Copy()
284+
h.Styles.FullDesc = h.Styles.ShortDesc.Copy()
285+
h.Styles.FullSeparator = h.Styles.ShortSeparator.Copy()
286+
h.Styles.Ellipsis = lipgloss.NewStyle().
287+
Foreground(lipgloss.Color(warningYellow)).
288+
Bold(true)
262289

263290
commandMenu := newCommandMenuModel(uiStyles)
264291

0 commit comments

Comments
 (0)