mirror of
https://github.com/makew0rld/amfora.git
synced 2024-12-04 14:46:29 -05:00
✨ Number keys for links - fixes #47
This commit is contained in:
parent
aa4edc4344
commit
cfc528d311
@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
- <kbd>Tab</kbd> now also enters link selecting mode, like <kbd>Enter</kbd> (#48)
|
- <kbd>Tab</kbd> now also enters link selecting mode, like <kbd>Enter</kbd> (#48)
|
||||||
|
- Number keys can be pressed to navigate to links 1 through 10 (#47)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- You can't change link selection while the page is loading
|
- You can't change link selection while the page is loading
|
||||||
|
@ -317,6 +317,19 @@ func Init() {
|
|||||||
tabs[curTab].pageDown()
|
tabs[curTab].pageDown()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Number key: 1-9, 0
|
||||||
|
i, err := strconv.Atoi(string(event.Rune()))
|
||||||
|
if err == nil {
|
||||||
|
if i == 0 {
|
||||||
|
i = 10 // 0 key is for link 10
|
||||||
|
}
|
||||||
|
if i <= len(tabs[curTab].page.Links) && i > 0 {
|
||||||
|
// It's a valid link number
|
||||||
|
followLink(tabs[curTab], tabs[curTab].page.Url, tabs[curTab].page.Links[i-1])
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// All the keys and operations that can work while a tab IS loading
|
// All the keys and operations that can work while a tab IS loading
|
||||||
|
Loading…
Reference in New Issue
Block a user