Skip to content

Commit

Permalink
Added TODO, new credits. Updated version number in files
Browse files Browse the repository at this point in the history
  • Loading branch information
greyblake committed Jan 6, 2011
1 parent b17afe4 commit 7963872
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
14 changes: 13 additions & 1 deletion README.markdown
Expand Up @@ -44,9 +44,21 @@ To install the plugin just copy `autoload`, `plugin`, `doc` directories into you
I want to remind that \<Leader\> in most cases is "\\" key. I want to remind that \<Leader\> in most cases is "\\" key.




## Know bugs

* When forked application(browser) is closed earlier than Vim it becomes a zombie. Some work is done about it. See Preview#show_with method.


## TODO

* Make more unique names for temporary files than just base name ending with `.html`. There should be `vim_preview` prefix, PID of Vim and number of buffer to guarantee avoiding conflicts.
* Add ability to use alternative gems for processing markdown and other formats.


## Credits ## Credits


* [Donald Ephraim Curtis](https://github.com/decurtis) (some support for OSX and Safari) * [Donald Ephraim Curtis](https://github.com/decurtis) - some support for OSX and Safari, fixing bugs
* [Sung Pae](https://github.com/guns) - fixing bugs




## License ## License
Expand Down
8 changes: 6 additions & 2 deletions autoload/preview.vim
Expand Up @@ -2,7 +2,7 @@
" File: preview.vim " File: preview.vim
" Description: Vim global plugin to preview markup files(markdown,rdoc,textile) " Description: Vim global plugin to preview markup files(markdown,rdoc,textile)
" Author: Sergey Potapov (aka Blake) <blake131313 AT gmail DOT com> " Author: Sergey Potapov (aka Blake) <blake131313 AT gmail DOT com>
" Version: 0.1 " Version: 0.4
" Homepage: http://github.com/greyblake/vim-preview " Homepage: http://github.com/greyblake/vim-preview
" License: GPLv2+ -- look it up. " License: GPLv2+ -- look it up.
" Copyright: Copyright (C) 2010 Sergey Potapov (aka Blake) " Copyright: Copyright (C) 2010 Sergey Potapov (aka Blake)
Expand Down Expand Up @@ -89,6 +89,7 @@ class Preview
private private


# TODO: handle errors when app can't be opened # TODO: handle errors when app can't be opened
# TODO: make zombies be always handled
def show_with(app_type, ext="html") def show_with(app_type, ext="html")
path = tmp_write(ext, yield) path = tmp_write(ext, yield)
app = get_apps_by_type(app_type).find{|app| system("which #{app.split()[0]} &> /dev/null")} app = get_apps_by_type(app_type).find{|app| system("which #{app.split()[0]} &> /dev/null")}
Expand All @@ -97,7 +98,10 @@ class Preview
[STDOUT, STDERR].each { |io| io.reopen("/dev/null", "w") } [STDOUT, STDERR].each { |io| io.reopen("/dev/null", "w") }
exec app, path exec app, path
end end
Process.detach pid # avoid zombies # Avoid zombies.
# Not sure that it works, because main thread finished earlier than
# the forked application finished
Process.detach pid
else else
error "any of apllications you specified in #{OPTIONS[app_type_to_opt(app_type)]} are not available" error "any of apllications you specified in #{OPTIONS[app_type_to_opt(app_type)]} are not available"
end end
Expand Down
10 changes: 7 additions & 3 deletions doc/preview.txt
Expand Up @@ -2,7 +2,7 @@


Description: Vim global plugin to preview markup files(markdown,rdoc,textile) Description: Vim global plugin to preview markup files(markdown,rdoc,textile)
Author: Sergey Potapov (aka Blake) <blake131313 AT gmail DOT com> Author: Sergey Potapov (aka Blake) <blake131313 AT gmail DOT com>
Version: 0.1 Version: 0.4
Homepage: http://github.com/greyblake/vim-preview Homepage: http://github.com/greyblake/vim-preview
License: GPLv2+ -- look it up. License: GPLv2+ -- look it up.
Copyright: Copyright (C) 2010 Sergey Potapov (aka Blake) Copyright: Copyright (C) 2010 Sergey Potapov (aka Blake)
Expand Down Expand Up @@ -186,14 +186,18 @@ Also you can map some other commands which is not mapped by default. E.g. >
============================================================================== ==============================================================================
8. Known Bugs *PreviewBugs* 8. Known Bugs *PreviewBugs*


There is no known bugs. If you found a bug please report it. * When forked application(browser) is closed earlier than Vim it becomes
a zombie. Some work is done about it. See Preview#show_with method.

If you found other bugs please report it.
See |PreviewContact| for a contact. See |PreviewContact| for a contact.




============================================================================== ==============================================================================
9. Credits *PreviewCredits* 9. Credits *PreviewCredits*


* Donald Ephraim Curtis (some support for OSX and Safari) * Donald Ephraim Curtis - some support for OSX and Safari, fixing bugs
* Sung Pae - fixing bugs




============================================================================== ==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion plugin/preview.vim
Expand Up @@ -2,7 +2,7 @@
" File: preview.vim " File: preview.vim
" Description: Vim global plugin to preview markup files(markdown,rdoc,textile) " Description: Vim global plugin to preview markup files(markdown,rdoc,textile)
" Author: Sergey Potapov (aka Blake) <blake131313 AT gmail DOT com> " Author: Sergey Potapov (aka Blake) <blake131313 AT gmail DOT com>
" Version: 0.1 " Version: 0.4
" Homepage: http://github.com/greyblake/vim-preview " Homepage: http://github.com/greyblake/vim-preview
" License: GPLv2+ -- look it up. " License: GPLv2+ -- look it up.
" Copyright: Copyright (C) 2010 Sergey Potapov (aka Blake) " Copyright: Copyright (C) 2010 Sergey Potapov (aka Blake)
Expand Down

0 comments on commit 7963872

Please sign in to comment.