Skip to content

Commit

Permalink
Bind the home key to switch to the first tab
Browse files Browse the repository at this point in the history
  • Loading branch information
zorbash committed Mar 12, 2020
1 parent 2e4ef71 commit da5cbda
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

## [0.1.1] - 2020-03-12

### Added

* `home` button switches to the first tab
* Opening a browser window to edit an alias with the `:e` command
* Support for switching between tabs using the `tab` key

## [0.1.0] - 2020-03-07

### Added

* Initial release
4 changes: 2 additions & 2 deletions lib/tefter_cli/app/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule TefterCli.App.State do
@ctrl_b key(:ctrl_b)
@ctrl_a key(:ctrl_a)
@ctrl_l key(:ctrl_l)
@ctrl_s key(:ctrl_s)
@search_keys [key(:ctrl_s), key(:home)]
@ctrl_h key(:ctrl_h)
@f5 key(:f5)
@tab key(:tab)
Expand Down Expand Up @@ -68,7 +68,7 @@ defmodule TefterCli.App.State do
Enum.at(tabs, rem(Enum.find_index(tabs, &(&1 == state[:tab])) + 1, length(tabs)))
)

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

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

0 comments on commit da5cbda

Please sign in to comment.