Skip to content

Commit

Permalink
Version 0.4
Browse files Browse the repository at this point in the history
Main Improvements:  - Added support for all inputs in a form (file, textarea, multi-options)  - Improved searching capabilities: Added the possibility to customize the     search engine, added :Dictionary and :Thesaurus commands. The searching     commands can now have no arguments, taking the word under the cursor, or      the visaully select words as arguments, instead (Thanks to Aditya Mahajan     for the ideas)  - The browser buffer is now non-modifiable by default. It becomes     modifiable only when changing form input values (again thanks to Aditya     Mahajan)  - Added the possibility to save inline images to a file  - Removed the dependence on HTML-Format. The only dependency that remains     for formatting is HTML::TreeBuilder (which is more widely available).  - There is no longer need to patch HTML::TreeBuilder to view encodings     correctly.  - I think vimbrowse.pl finally works on windows (didn't test, though). Some     environment variables might need to be set.  - Various other features and bug fixes - see the ChangeLog for details
  • Loading branch information
mkamensky authored and vim-scripts committed Nov 14, 2010
1 parent 58d9cc9 commit 2b473c5
Show file tree
Hide file tree
Showing 17 changed files with 1,472 additions and 362 deletions.
40 changes: 40 additions & 0 deletions ChangeLog
@@ -1,3 +1,43 @@
* Version 0.4

Main Improvements:
- Improved and added searching commands: Added a special bookmarks
file, _search, and commands :Search, :SearchUsing and :Keyword using
it.
- Encoding displayed correctly, without need to patch the (system
wide) HTML::TreeBuilder.
- Removed dependence of the HTML-Format bundle (now depends only on
HTML-Tree).
- The browser pages are not modifiable by default. This is safer, and
looks much better with the conceal patch.
- All input types are now supported (added file, textarea, and option
with "multiple" attribute).
- Added the possibility to save inline images.

Main code changes:
- HTML::FormatText::Vim no longer depends on HTML::FormatText and on
HTML::Formatter. The only dependancy is HTML::TreeBuilder (which is
also a pre-requisit for HTML::Formatter), which appears to be much
more widely available. The full explanation is in the
HTML::FormatText::Vim pod.
- Using a tiny derived class of HTML::TreeBuilder,
HTML::TreeBuilder::Encode, to solve the encoding problems. This
class is defined in HTML::FormatText::Vim.
- VIM::Browser changes: moved much of the handling of fetching a new
page from the page class to the main package (VIM::Browser). The
%FORMAT hash now contains only formatting routines.

Other changes:
- Added support for some extra tags: nobr, wbr, underline, dfn.
- vimbrowse.pl should now finally work on windows.
- :Reload now works correctly and prompts in case the page is a result
of posting a form.
- removed the few function descriptions that were available in the
documentation.
- The 'c' flag in the guioptions is taken into account, whenever
possible.
- Lots of bug fixes

* Version 0.3.1

Bug fix:
Expand Down
6 changes: 3 additions & 3 deletions INSTALL
Expand Up @@ -3,15 +3,15 @@ Installation of the browser.vim plugin

1. Requirements

This plugin is mostly written in perl, so you need a perl-enable vim version
to use it. In addition, the perl modules HTML::FormatText, LWP::UserAgent and
This plugin is mostly written in perl, so you need a perl-enabled vim version
to use it. In addition, the perl modules HTML::TreeBuilder, LWP::UserAgent and
URI from cpan are required. One way to install these modules is by running:

cpan LWP::UserAgent

etc. Most linux distribution provide their own way of installing perl
modules. The corresponding packages should be named something like
HTML-Format, libwww-perl and URI.
HTML-Tree, libwww-perl and URI.

The plugin was tested on linux, with vim 6.3 and perl 5.8.4.

Expand Down
24 changes: 5 additions & 19 deletions README.encoding
Expand Up @@ -16,25 +16,11 @@ various encodings.

4. If you see stuff like „ instead of actual characters, you need to
re-install HTML::Parser. When installing it, answer 'y' to the question
about unicode entities (If you happen to be using gentoo linux, you can
find a modified ebuild that does it on gentoo bugzilla).

5. If things are still not displayed correctly, it might be because of a bug
somewhere between HTML::Parser and perl. People seem to be aware of it, so
one day it will probably be fixed. Meanwhile, there is a workaround, but
it involves editing HTML::TreeBuilder: First, find its location. You can
do it by running

perl -MHTML::TreeBuilder -e 'warn $INC{"HTML/TreeBuilder.pm"}'

Edit that file, find the 'sub text {', and then the first line where
'$text' appears (in my version, which is 3.13, this is line 984).
Immediately after that line, add the following two lines:

use Encode;
$text = decode_utf8($text);

This should make all problems disappear.
about unicode entities

Remark: It is no longer necessary to make any modification to
HTML::TreeBuilder, as it is now dealt with internally (But that bug may
affect other applications using this module).

If you still see any encoding problems (as well as other problems), please
send them to me, with the page where it happened.
Expand Down
23 changes: 16 additions & 7 deletions bin/vimbrowse.pl
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
# File Name: vimbrowse.pl
# Maintainer: Moshe Kaminsky <kaminsky@math.huji.ac.il>
# Last Update: September 17, 2004
# Last Update: September 26, 2004
###########################################################

use warnings;
Expand All @@ -10,14 +10,21 @@
use File::Spec::Functions;

BEGIN {
our $VERSION = 0.3;

our $VERSION = 0.4;
sub broken { $^O eq 'MSWin32' }

# Don't know where to look for gvim on windows - let's try the PATH
our $VIM = $^O eq 'MSWin32' ? 'gvim' : '/usr/bin/gvim';
our $VIM = broken() ? 'gvim' : '/usr/bin/gvim';
$VIM = $ENV{'VIMBIN'} if $ENV{'VIMBIN'};
# for some reason, gvim on windows doesn't like stdout, so we use vim
# instead of gvim to get the serverlist, which we assume to be in the
# same directory as gvim
our $SERVERLIST = catfile(dirname($VIM), 'vim') . ' --serverlist';
my $vimdir = dirname($VIM);
my @vimpath = qw(vim);
unshift @vimpath, $vimdir unless $vimdir eq curdir;
our $SERVERLIST = catfile(@vimpath) . ' --serverlist';
$VIM = 'start ' . $VIM if broken();
our $HOMEPAGE = $ENV{'HOMEPAGE'} || 'http://vim.sf.net/';
our $SERVERNAME = 'VIMBROWSER';

Expand Down Expand Up @@ -80,15 +87,17 @@ sub sys {

my $VimCmd = "$VIM --servername $ServerName --remote-send";

sys("$VimCmd ':set $VimOpts<CR>'") if $VimOpts;
# windows doesn't like single quotes. *sigh*
my $q = broken() ? '"' : "'";
sys("$VimCmd $q:set $VimOpts<CR>$q") if $VimOpts;

exit unless @ARGV;

sys("$VimCmd ':$BrowseFirstCmd " . shift(@ARGV) . "$ExtraFirst<CR>'");
sys("$VimCmd $q:$BrowseFirstCmd " . shift(@ARGV) . "$ExtraFirst<CR>$q");

foreach ( @ARGV ) {
sleep 1;
sys("$VimCmd ':$SplitCmd $_<CR>'");
sys("$VimCmd $q:$SplitCmd $_<CR>$q");
}

__DATA__
Expand Down

0 comments on commit 2b473c5

Please sign in to comment.