mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-21 07:34:18 +02:00
Remove newlines the linter is complaining about
This commit is contained in:
parent
06cbbd7b6b
commit
b296cbb780
3 changed files with 0 additions and 17 deletions
|
|
@ -115,7 +115,6 @@ type pagerModel struct {
|
|||
}
|
||||
|
||||
func newPagerModel(glamourStyle string) pagerModel {
|
||||
|
||||
// Init viewport
|
||||
vp := viewport.Model{}
|
||||
vp.YPosition = 0
|
||||
|
|
@ -176,7 +175,6 @@ func (m *pagerModel) toggleHelp() {
|
|||
// that the the returned command should be sent back the through the pager
|
||||
// update function.
|
||||
func (m *pagerModel) showStatusMessage(statusMessage string) tea.Cmd {
|
||||
|
||||
// Show a success message to the user
|
||||
m.state = pagerStateStatusMessage
|
||||
m.statusMessageHeader = statusMessage
|
||||
|
|
@ -211,7 +209,6 @@ func pagerUpdate(msg tea.Msg, m pagerModel) (pagerModel, tea.Cmd) {
|
|||
)
|
||||
|
||||
switch msg := msg.(type) {
|
||||
|
||||
case tea.KeyMsg:
|
||||
switch m.state {
|
||||
case pagerStateSetNote:
|
||||
|
|
@ -507,7 +504,6 @@ func renderWithGlamour(m pagerModel, md string) tea.Cmd {
|
|||
|
||||
// This is where the magic happens.
|
||||
func glamourRender(m pagerModel, markdown string) (string, error) {
|
||||
|
||||
if !config.GlamourEnabled {
|
||||
return markdown, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -284,7 +284,6 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
var cmds []tea.Cmd
|
||||
|
||||
switch msg := msg.(type) {
|
||||
|
||||
case errMsg:
|
||||
m.err = msg
|
||||
|
||||
|
|
@ -373,13 +372,10 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
|
||||
switch m.state {
|
||||
case stashStateReady:
|
||||
|
||||
switch msg := msg.(type) {
|
||||
|
||||
// Handle keys
|
||||
case tea.KeyMsg:
|
||||
switch msg.String() {
|
||||
|
||||
case "k", "up":
|
||||
m.index--
|
||||
if m.index < 0 && m.paginator.Page == 0 {
|
||||
|
|
@ -483,7 +479,6 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
m.state = stashStateShowingError
|
||||
return m, nil
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +518,6 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
case stashStatePromptDelete:
|
||||
if msg, ok := msg.(tea.KeyMsg); ok {
|
||||
switch msg.String() {
|
||||
|
||||
// Confirm deletion
|
||||
case "y":
|
||||
if m.state != stashStatePromptDelete {
|
||||
|
|
@ -586,7 +580,6 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
if _, ok := msg.(tea.KeyMsg); ok {
|
||||
m.state = stashStateReady
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If an item is being confirmed for delete, any key (other than the key
|
||||
|
|
@ -598,7 +591,6 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
// VIEW
|
||||
|
||||
func stashView(m stashModel) string {
|
||||
|
||||
var s string
|
||||
switch m.state {
|
||||
case stashStateShowingError:
|
||||
|
|
@ -796,7 +788,6 @@ func stashHelpViewBuilder(windowWidth int, sections ...string) string {
|
|||
)
|
||||
|
||||
for i := 0; i < len(sections); i++ {
|
||||
|
||||
// If we need this more often we'll formalize something rather than
|
||||
// use an if clause/switch here.
|
||||
switch sections[i] {
|
||||
|
|
|
|||
4
ui/ui.go
4
ui/ui.go
|
|
@ -215,7 +215,6 @@ func update(msg tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) {
|
|||
// Special cases for the pager
|
||||
case stateShowDocument:
|
||||
switch m.pager.state {
|
||||
|
||||
// If setting a note send all keys straight through
|
||||
case pagerStateSetNote:
|
||||
var batch []tea.Cmd
|
||||
|
|
@ -236,7 +235,6 @@ func update(msg tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) {
|
|||
return m, tea.Batch(batch...)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return m, tea.Quit
|
||||
|
|
@ -348,7 +346,6 @@ func update(msg tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) {
|
|||
|
||||
// Process children
|
||||
switch m.state {
|
||||
|
||||
case stateShowStash:
|
||||
newStashModel, cmd := stashUpdate(msg, m.stash)
|
||||
m.stash = newStashModel
|
||||
|
|
@ -366,7 +363,6 @@ func update(msg tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) {
|
|||
// VIEW
|
||||
|
||||
func view(mdl tea.Model) string {
|
||||
|
||||
m, ok := mdl.(model)
|
||||
if !ok {
|
||||
return "could not perform assertion on model in view"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue