Commit b95c5689 authored by Naoki OKAMURA's avatar Naoki OKAMURA

bugfix: fix about process of encoded-URL, and open new file via this protocol

parent 9bd62b0d
......@@ -9,6 +9,9 @@ our $URI_RE = qr{kalaclista:([^/]+?)/([^.]+)\.md};
sub main {
my $protocol = shift;
my ( $website, $path ) = ( $protocol =~ $URI_RE );
$path =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
my $file = join q{/}, ( $BASE_DIR, "src", $website, "content", "${path}.md" );
if ( ! -e $file ) {
......@@ -68,6 +71,10 @@ sub main {
my $code = system(qw(tmux list-sessions));
if ( $code != 0 ) {
open(my $eh, '>', $BASE_DIR . "/.edit");
print $eh $file;
close($eh);
system(qq< mlterm -e zsh -c 'cd "${BASE_DIR}" && tmux-up' >);
} else {
system(qq< tmux new-window -a -c "${BASE_DIR}" vim -c NERDTree ${file} >);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment