Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gooli/termenu into gooli-…
Browse files Browse the repository at this point in the history
…master
  • Loading branch information
koreno committed Sep 6, 2015
2 parents f93903f + 3ee66f2 commit 23c3652
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion termenu-cmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Examples:
parser.add_option("-w", "--width", type="int", help="Max width [terminal width]", metavar="N", default=None)
parser.add_option("-o", "--one", action="store_true", help="Don't show a menu if only one option was given")
parser.add_option("-p", "--precolored", action="store_true", help="Preserve ANSI coloring in supplied options")
parser.add_option("-i", "--inline", action="store_true", help="Show small inline menu on a sinel line")
parser.add_option("-i", "--inline", action="store_true", help="Show small inline menu on a single line")
parser.add_option("--single", dest="multiselect", action="store_false", default=True, help="Single selection only")
(options, args) = parser.parse_args()

Expand Down
3 changes: 3 additions & 0 deletions termenu/termenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ def _on_key(self, key):
ansi.hide_cursor()
prevent = True
self._refilter()
elif not self.host.options and key == "space":
prevent = True

if not prevent:
return self.parent._on_key(key)
Expand All @@ -383,6 +385,7 @@ def _refilter(self):
self.host.options.append(option)
# select the first matching element (showAlways elements might not match)
self.host.scroll = 0
self.host.cursor = 0
for i, option in enumerate(self.host.options):
if not option.attrs.get("showAlways") and text in option.text.lower():
self.host.cursor = i
Expand Down
2 changes: 1 addition & 1 deletion termenu/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.1.4"
version = "1.1.6"

0 comments on commit 23c3652

Please sign in to comment.