Skip to content

Commit

Permalink
Fix crash when indexing raw content for a url
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianopz committed Jul 10, 2023
1 parent 67652f0 commit c30e96b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pkg/display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ func (d *display) currentRow() int {
return d.cy - 1 + d.startoff
}

func (d *display) currentUrl() string {
return string(d.raw[d.currentRow()])
}

func (d *display) resetCoordinates() {
d.cy = 1
d.cx = 1
Expand Down
5 changes: 2 additions & 3 deletions pkg/display/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,12 @@ func (d *display) whileReading(input byte, quitC chan bool) {

case ascii.ENTER:
{
url := string(d.raw[d.currentRow()])

switch d.currentSection {
case URLS_LIST:
d.loadArticlesList(url)
d.loadArticlesList(d.currentUrl())
case ARTICLES_LIST:
d.loadArticleText(url)
d.loadArticleText(d.currentUrl())
}
}

Expand Down

0 comments on commit c30e96b

Please sign in to comment.