From d1fd532c0c73bd318387b7053fc4276a0590f01a Mon Sep 17 00:00:00 2001 From: Gerhard Gonter <ggonter@gmail.com> Date: Wed, 11 Feb 2015 18:10:09 +0100 Subject: [PATCH] add option to edit with $EDITOR which should be vi --- perl/Gnome-Tomboy/tom | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/perl/Gnome-Tomboy/tom b/perl/Gnome-Tomboy/tom index 3b22d2b..fac21fd 100755 --- a/perl/Gnome-Tomboy/tom +++ b/perl/Gnome-Tomboy/tom @@ -53,6 +53,7 @@ my $note_dir= $ENV{'HOME'} . '/.local/share/tomboy'; my $note_dir_changed= 0; my $start_tb= 0; +my $start_visual_editor= 0; # AKA $EDITOR my $dump_note= 0; my $toc; my $op_code; @@ -81,6 +82,7 @@ while (my $arg= shift (@ARGV)) if ($a eq 'd') { $note_dir= shift (@ARGV); $note_dir_changed= 1; } elsif ($a eq 't') { $toc_file= shift (@ARGV); } elsif ($a eq 'e') { $start_tb= 1; } + elsif ($a eq 'v') { $start_visual_editor= 1; } elsif ($a eq 'D') { $dump_note= 1; } else { @@ -167,6 +169,13 @@ sub find_note push (@par, '--note-path', $note_dir) if ($note_dir_changed); Tomboy::start_tb (@par); } + elsif ($start_visual_editor) + { + my $fnm= join ('/', $note_dir, $uuid . '.note'); + my $editor= $ENV{'EDITOR'} || '/usr/bin/vi'; + print ">>> [", join (' ', $editor, $fnm), "]\n"; + system ($editor, $fnm); + } elsif ($dump_note) { dump_note($uuid{$uuid}->{'fnm'}); -- GitLab