Skip to content

Commit da5cbda

Browse files
committed
Bind the home key to switch to the first tab
1 parent 2e4ef71 commit da5cbda

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

CHANGELOG

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## Unreleased
6+
7+
## [0.1.1] - 2020-03-12
8+
9+
### Added
10+
11+
* `home` button switches to the first tab
12+
* Opening a browser window to edit an alias with the `:e` command
13+
* Support for switching between tabs using the `tab` key
14+
15+
## [0.1.0] - 2020-03-07
16+
17+
### Added
18+
19+
* Initial release

lib/tefter_cli/app/state.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule TefterCli.App.State do
1111
@ctrl_b key(:ctrl_b)
1212
@ctrl_a key(:ctrl_a)
1313
@ctrl_l key(:ctrl_l)
14-
@ctrl_s key(:ctrl_s)
14+
@search_keys [key(:ctrl_s), key(:home)]
1515
@ctrl_h key(:ctrl_h)
1616
@f5 key(:f5)
1717
@tab key(:tab)
@@ -68,7 +68,7 @@ defmodule TefterCli.App.State do
6868
Enum.at(tabs, rem(Enum.find_index(tabs, &(&1 == state[:tab])) + 1, length(tabs)))
6969
)
7070

71-
{%{token: "" <> _}, {:event, %{key: @ctrl_s}}} ->
71+
{%{token: "" <> _}, {:event, %{key: key}}} when key in @search_keys ->
7272
put_in(state[:tab], :search)
7373

7474
{%{token: "" <> _}, {:event, %{key: @ctrl_l}}} ->

0 commit comments

Comments
 (0)