source: perl/lib/BarnOwl/Help.pm @ 42a0c8b

release-1.10release-1.6release-1.7release-1.8release-1.9
Last change on this file since 42a0c8b was b30c256, checked in by David Benjamin <davidben@mit.edu>, 15 years ago
Add edit:help command for zsh-style in-edit help zsh has this convenient feature where pressing M-h while typing a command will look up the man page for the current command and fully restore your editting session afterwards. This command brings a similar feature to BarnOwl. Instead of launching man, we open the usual popwin, which is much easier to restore from. Signed-off-by: David Benjamin <davidben@mit.edu>
  • Property mode set to 100644
File size: 301 bytes
Line 
1use warnings;
2use strict;
3
4package BarnOwl::Help;
5
6use BarnOwl::Parse qw(tokenize);
7use BarnOwl::Editwin qw(text_before_point text_after_point);
8
9sub show_help {
10    my $cmd = shift;
11
12    my $words = tokenize(text_before_point() . text_after_point());
13    BarnOwl::help($words->[0]) if @$words;
14}
15
161;
Note: See TracBrowser for help on using the repository browser.