line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Goo::Editor; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
# Nigel Hamilton |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2005 |
7
|
|
|
|
|
|
|
# All Rights Reserved |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
10
|
|
|
|
|
|
|
# Filename: Goo::Editor.pm |
11
|
|
|
|
|
|
|
# Description: Edit a program interactively as fast as possible |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Date Change |
14
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
# 23/06/2005 Version 1 |
16
|
|
|
|
|
|
|
# 01/08/2005 Simplified due to new architecture |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
############################################################################### |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
44579
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
6
|
use Goo::Object; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
18
|
|
23
|
1
|
|
|
1
|
|
6
|
use Goo::TextEditor; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
24
|
1
|
|
|
1
|
|
5
|
use Goo::ThereDocManager; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
6
|
use base qw(Goo::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
214
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
############################################################################### |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
# run - execute |
32
|
|
|
|
|
|
|
# |
33
|
|
|
|
|
|
|
############################################################################### |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub run { |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
1
|
|
my ($this, $thing, $line_number) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# sometimes we need to make an intelligent jump |
40
|
|
|
|
|
|
|
# maybe this will be handled by the JumpManager |
41
|
|
|
|
|
|
|
# in the future - in the shortterm this provides |
42
|
|
|
|
|
|
|
# some magic |
43
|
|
|
|
|
|
|
# need to provide a line number here |
44
|
|
|
|
|
|
|
# so we can jump directly |
45
|
0
|
|
|
|
|
|
Goo::TextEditor::edit($thing->get_full_path(), $line_number); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# analyse for ThereDocs > > > |
48
|
0
|
|
|
|
|
|
my ($theredoc_line_number, $target_thing, $target_action, $target_line_number) = |
49
|
|
|
|
|
|
|
Goo::ThereDocManager->new()->process($thing->get_full_path()); |
50
|
|
|
|
|
|
|
|
51
|
0
|
0
|
|
|
|
|
if ($target_thing) { |
52
|
0
|
|
|
|
|
|
$target_thing->do_action($target_action, $target_line_number); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Goo::Editor - Call an external editor like vi or nano to edit a file. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SYNOPSIS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
use Goo::Editor; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 DESCRIPTION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Wrap an external editor like vi or nano. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Editor is a top level action handler. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 METHODS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item run |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
edit the file |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=back |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHOR |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SEE ALSO |
91
|
|
|
|
|
|
|
|