Term-ReadLine-TTYtter
view release on metacpan or search on metacpan
New variable $readline::rl_default_selected; if true, default string
is removed if the first keystroke is self-insert or BackSpace;
test.pl modified to test this too;
uses mr,me capabilities to highlight the default string.
New command: SaveLine (on M-#).
New command: PrintHistory (on M-h),
PreviousHistory and NextHistory take count.
The edited line is saved when one moves to history.
1.0205: Do not touch $ENV{HOME} unless defined.
$ENV{AUTOMATED_TESTING} to skip interactive tests.
1.0206: Shift-Ins, Control-Ins, Shift-Del operate on clipboard (if available)
(currently native on OS/2 only, otherwise uses commands
$ENV{RL_PASTE_CMD}, $ENV{RL_CLCOPY_CMD}, or file
$ENV{HOME}/.rl_cutandpaste).
In absense of mark, CopyRegionAsKillClipboard operates
on the whole line
Completely ignore unknown variables in .inputrc.
Moving cursor should remove the highlight of initial string too.
Change some local() to my().
Region between point and mark is highlighted.
Commands SelfInsert, Yank*, *DeleteChar remove this region
ReadLine/readline_ttytter.pm view on Meta::CPAN
sub F_OverwriteMode;
sub F_InsertMode;
sub F_ToggleInsertMode;
sub F_Suspend;
sub F_Ding;
sub F_PossibleCompletions;
sub F_Complete;
sub F_YankClipboard;
sub F_CopyRegionAsKillClipboard;
sub F_KillRegionClipboard;
sub clipboard_set;
sub F_BeginUndoGroup;
sub F_EndUndoGroup;
sub F_DoNothing;
sub F_ForceMemorizeDigitArgument;
sub F_MemorizeDigitArgument;
sub F_UnmemorizeDigitArgument;
sub F_ResetDigitArgument;
sub F_MergeInserts;
sub F_MemorizePos;
sub F_BeginPasteGroup;
ReadLine/readline_ttytter.pm view on Meta::CPAN
sub F_CopyRegionAsKill {
return F_Ding unless $line_rl_mark == $rl_HistoryIndex;
$rl_mark = length $line if $rl_mark > length $line;
my ($s, $e) = ($rl_mark, $D);
($s, $e) = ($e, $s) if $s > $e;
$ThisCommandKilledText = 1 + $s;
$KillBuffer = '' if !$LastCommandKilledText;
$KillBuffer .= substr($line, $s, $e - $s);
}
sub clipboard_set {
my $in = shift;
if ($^O eq 'os2') {
eval {
require OS2::Process;
OS2::Process::ClipbrdText_set($in); # Do not disable \r\n-conversion
1
} and return;
} elsif ($^O eq 'MSWin32') {
eval {
require Win32::Clipboard;
ReadLine/readline_ttytter.pm view on Meta::CPAN
$mess = "Writing to file `$ENV{HOME}/.rl_cutandpaste'";
open COPY, "> $ENV{HOME}/.rl_cutandpaste" or warn("$mess: $!"), return;
} else {
return;
}
print COPY $in;
close COPY or warn("$mess: closing $!");
}
sub F_CopyRegionAsKillClipboard {
return clipboard_set($line) unless $line_rl_mark == $rl_HistoryIndex;
&F_CopyRegionAsKill;
clipboard_set($KillBuffer);
}
sub F_KillRegionClipboard {
&F_KillRegion;
clipboard_set($KillBuffer);
}
sub F_YankClipboard
{
remove_selection();
my $in;
if ($^O eq 'os2') {
eval {
require OS2::Process;
$in = OS2::Process::ClipbrdText();
( run in 0.692 second using v1.01-cache-2.11-cpan-2398b32b56e )