1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-06-15 19:15:24 +00:00

Revert "🚸 Support numpad enter key"

This reverts commit 4b78a13140.
See #123 for more info on why this was reverted.
This commit is contained in:
makeworld 2020-11-21 19:35:17 -05:00
parent 4b78a13140
commit a04c281ae0
6 changed files with 5 additions and 12 deletions

View File

@ -5,9 +5,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Support numpad enter key (#123)
### Changed
- Updated [go-gemini](https://github.com/makeworld-the-better-one/go-gemini) to v0.9.1 to support CN-only wildcard certs
- Preformatted text is now light yellow by default

View File

@ -10,5 +10,4 @@ Thank you to the following contributors, who have helped make Amfora great. FOSS
- Timur Ismagilov (@bouncepaw)
- Matt Caroll (@ohiolab)
- Patryk Niedźwiedziński (@pniedzwiedzinski)
- Trevor Slocum (@tsclocum)
- Cole Helbling (@cole-h)
- Trevor Slocum (@tsclocum)

View File

@ -115,7 +115,7 @@ func Init() {
//nolint:exhaustive
switch key {
case tcell.KeyEnter, KeyNumpadEnter:
case tcell.KeyEnter:
// Figure out whether it's a URL, link number, or search
// And send out a request

View File

@ -63,7 +63,7 @@ func Help() {
func helpInit() {
// Populate help table
helpTable.SetDoneFunc(func(key tcell.Key) {
if key == tcell.KeyEsc || key == tcell.KeyEnter || key == KeyNumpadEnter {
if key == tcell.KeyEsc || key == tcell.KeyEnter {
tabPages.SwitchToPage(strconv.Itoa(curTab))
App.SetFocus(tabs[curTab].view)
App.Draw()

View File

@ -76,7 +76,7 @@ func makeNewTab() *tab {
currentSelection := tabs[tab].view.GetHighlights()
numSelections := len(tabs[tab].page.Links)
if (key == tcell.KeyEnter || key == KeyNumpadEnter) && len(currentSelection) > 0 {
if key == tcell.KeyEnter && len(currentSelection) > 0 {
// A link is selected and enter was pressed: "click" it and load the page it's for
bottomBar.SetLabel("")
linkN, _ := strconv.Atoi(currentSelection[0])
@ -85,7 +85,7 @@ func makeNewTab() *tab {
followLink(tabs[tab], tabs[tab].page.URL, tabs[tab].page.Links[linkN])
return
}
if len(currentSelection) == 0 && (key == tcell.KeyEnter || key == KeyNumpadEnter || key == tcell.KeyTab) {
if len(currentSelection) == 0 && (key == tcell.KeyEnter || key == tcell.KeyTab) {
// They've started link highlighting
tabs[tab].page.Mode = structs.ModeLinkSelect

View File

@ -5,15 +5,12 @@ import (
"net/url"
"strings"
"github.com/gdamore/tcell"
"github.com/spf13/viper"
"gitlab.com/tslocum/cview"
)
// This file contains funcs that are small, self-contained utilities.
const KeyNumpadEnter = tcell.KeyCtrlJ
// escapeMeta santizes a META string for use within a cview modal.
func escapeMeta(meta string) string {
return cview.Escape(strings.ReplaceAll(meta, "\n", ""))