Skip to content

Commit

Permalink
🔀 Merge pull request #33 from davep/goto-search
Browse files Browse the repository at this point in the history
Fix search shortcut key not working
  • Loading branch information
davep authored Aug 2, 2024
2 parents 1fef972 + 76cf6ff commit b4722df
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# OSHit ChangeLog

## v0.12.4

**Released: 2024-08-02**

- Fixed a crash when the HackerNews API returns `null` for an otherwise
valid and available story.

## v0.12.3

**Released: 2024-07-24**
Expand Down
2 changes: 1 addition & 1 deletion oshit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__credits__ = ["Dave Pearson"]
__maintainer__ = "Dave Pearson"
__email__ = "davep@davep.org"
__version__ = "0.12.3"
__version__ = "0.12.4"
__licence__ = "GPLv3+"

##############################################################################
Expand Down
8 changes: 7 additions & 1 deletion oshit/app/screens/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Main(Screen[None]):
Binding("a", "go('ask')"),
Binding("s", "go('show')"),
Binding("j", "go('jobs')"),
Binding("r", "go('search')"),
Binding("/", "local_search"),
]

Expand Down Expand Up @@ -156,7 +157,12 @@ def action_go(self, items: str) -> None:
Args:
items: The name of the list of items to go to.
"""
self.query_one(HackerNews).active = items
before = self.query_one(HackerNews).active
try:
self.query_one(HackerNews).active = items
except ValueError:
self.query_one(HackerNews).active = before
return
self.query_one(HackerNews).focus_active_pane()

def action_compact(self) -> None:
Expand Down

0 comments on commit b4722df

Please sign in to comment.