Text::Editor::Perl - Perl source code head-less editor written in Perl.
Perl source code head-less editor written in Perl.
The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.
A new editor
Construct a new editor
Parameter Description 1 @attributes Attributes for a new editor
Example:
my $e = newEditor;
This is a static method and so should be invoked as:
Text::Editor::Perl::newEditor
Attributes for an editor
Name of the file from whence the text came
[Instruction to roll changes back or reapply them ...]
[lines of text to be editted ...]
[Views of the text ...]
Methods for a Attributes of a view
Create a new line
Parameter Description 1 $editor Editor 2 @attributes Attributes
my $l = $e->newLastLine();
Create a new view
my $v = $e->newEditorView(viewCursorLine=>$l, viewCursorChar=>0);
Print an editor
Parameter Description 1 $editor Editor
is_deeply $e->printEditor, {lines => ["Hello World"]};
A view of the text being editted
Attributes of a view
The editor that owns this view
Line the cursor is in
The char position of the cursor with 0 being just before the first character
The number of lines the cursor spans
The line number (numbered from zero) at which this view starts to display
The character position at which this view starts to display
The height of the view in rows
The width of the view in chars
[Selection specifications ...]
[Box specifications ...] - a rectangular selection
Parameter Description 1 @attributes Attributes
Text::Editor::Perl::newView
Add the specified chars through the specifed view
Parameter Description 1 $view View 2 $textToAdd Text to add
$v->viewAddChars(q(Hello World));
Print a view
Parameter Description 1 $view View
A selection delimits a contiguous block of text
Construct a new view of the data being editted
Parameter Description 1 @attributes Attributes for a new selection
Text::Editor::Perl::newSelection
Attributes for a selection
The view that owns this selection
The line number (numbered from zero) at which this selection starts
The character position at which this selection starts
The line number (numbered from zero) at which this selection ends
The character position at which this selection ends
A box is a rectangular block of text
Construct a new box
Parameter Description 1 @attributes Attributes for a new box
Text::Editor::Perl::newBox
Attributes for a box
The view that owns this box
The line number (numbered from zero) at which this box starts
The character position at which this box end
The width of the box in characters - can be positive, zero or negative
The height if the boc in lines - can be positive, zero or negative
A line holds a line of text being editted
Construct a new line
Parameter Description 1 @attributes Attributes for a new line
Text::Editor::Perl::newLine
Attributes for a line
The editor that contains this line
A string holding the text being editted
A vec string which bolds 8 bits for each character in the string describing its display attributes
A string naming this line
A string naming a command that starts or ends on this line
The line id visible if true
A snippet is a replacement string
Construct a new snippet
Parameter Description 1 @attributes Attributes for a new snippet
Text::Editor::Perl::newSnippet
Attributes for a snippet
The source to be expanded
Replacement string
cursor offset in replacement string
1 boxHeight
2 boxStartChar
3 boxStartLine
4 boxView
5 boxWidth
6 editorFile
7 editorLines
8 editorLog
9 editorViews
10 lineCharAttrs
11 lineCommand
12 lineEditor
13 lineLabel
14 lineText
15 lineVisible
16 newBox
17 newEditor
18 newEditorView
19 newLastLine
20 newLine
21 newSelection
22 newSnippet
23 newView
24 printEditor
25 printView
26 selectionEndChar
27 selectionEndLine
28 selectionStartChar
29 selectionStartLine
30 selectionView
31 snippetCursor
32 snippetReplacement
33 snippetSource
34 viewAddChars
35 viewBoxes
36 viewChars
37 viewCursorChar
38 viewCursorLine
39 viewCursorVertical
40 viewEditor
41 viewLines
42 viewSelections
43 viewStartChar
44 viewStartLine
This module is written in 100% Pure Perl and, thus, it is easy to read, comprehend, use, modify and install via cpan:
sudo cpan install Text::Editor::Perl
philiprbrenan@gmail.com
http://www.appaapps.com
Copyright (c) 2016-2018 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Text::Editor::Perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Editor::Perl
CPAN shell
perl -MCPAN -e shell install Text::Editor::Perl
For more information on module installation, please visit the detailed CPAN module installation guide.