App-Prima-REPL
view release on metacpan or search on metacpan
bin/prima-repl view on Meta::CPAN
tabs => ['Output'],
style => tns::Simple,
);
our $output = $notebook->insert_to_page(0, Edit =>
pack => { fill => 'both', expand => 1, padx => $padding, pady => $padding },
text => '',
cursorWrap => 1,
wordWrap => 1,
readOnly => 1,
backColor => cl::LightGray,
font => { name => 'courier new'},
);
# Over-ride the defaults for these:
$output->accelTable->insert([
['', '', km::Ctrl | kb::PageUp, \&goto_prev_page ] # previous
, ['', '', km::Ctrl | kb::PageDown, \&goto_next_page ] # next
], '', 0);
# Add the eval line:
our $inline = PrimaX::InputHistory->create(
bin/prima-repl view on Meta::CPAN
# Allow for insertions, deletions, newlines, etc
$widget->set(
tabIndent => 4,
syntaxHilite => 1,
wantTabs => 1,
wantReturns => 1,
wordWrap => 0,
autoIndent => 1,
cursorWrap => 1,
font => { pitch => fp::Fixed, style => fs::Bold, name => 'courier new'},
);
# Update the accelerators.
my $accTable = $widget->accelTable;
# Add some functions to the accelerator table
$accTable->insert([
# Ctrl-Enter runs the file
['CtrlReturn', '', kb::Return | km::Ctrl, sub{main::run_file()} ]
, ['CtrlEnter', '', kb::Enter | km::Ctrl, sub{main::run_file()} ]
bin/prima-repl view on Meta::CPAN
At the bottom of the App::Prima::REPL window is a single entry line for direct
command input. The main window is a set of tabs, the first of which is an output
tab. Additional tabs can contain files or any other extension that has been
written as a App::Prima::REPL tab.
If your project has project-specific notes, you should be able to find them
either here: L<prima-repl.initrc> or here: L<prima-repl.initrc.pl>.
=head1 Fixing Documentation Fonts
If your documentation fonts look bad, you can change them by going to
View->Set Font Encoding.
=head1 Basic Navigation
Before I launch into the tutorial, I want to cover some basic navigation to help
you quickly get around the REPL. The following keyboard shortcuts should be
helpful to you even as we get started:
Normal Keyboard Mac Laptop
CTRL-h CTRL-h open or switch to the help window
bin/prima-repl view on Meta::CPAN
first switch to the tab. This function takes the tab index (returned by
C<REPL::create_new_tab> in list context) and the desired widget. Note that
if you want C<CTRL-i> to toggle between the desired widget and the input
line, which is the behavior of the file buffers, you will need to have your
default widge properly respond to C<CTRL-i> keyboard input.
=item REPL::endow_editor_widget($widget)
Given a normal editor widget, this sets the various options to make the editor
behave like the default multiline buffer editor. For example, it turns on
syntax highlighting, sets a monospace font, and sets the default accelerator
keys. Although not strictly necessary for creating tabs, it may be useful if
you want to create a tab with both an editor and some other sort of widget,
side-by-side, as is done in L<App::Prima::REPL::Talk>.
This function does not set the widget as the tab's default widget, since you
may want the default widget to be something else. You should explicitly invoke
C<REPL::change_default_widget> (above) to do that.
The endowed editor has named key bindings that you can overwrite:
( run in 1.124 second using v1.01-cache-2.11-cpan-5735350b133 )