Re: [patch] Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Dominique Pelle

Benjamin Fritz wrote

 A patch is attached for the behavior discussed in these threads:
 http://groups.google.com/group/vim_use/browse_thread/thread/8532e7236f113ab7/0b508a50b767a1e1
 http://groups.google.com/group/vim_dev/browse_thread/thread/56d5debad6f5f351/44cc7eb3b4787440

 Also attached is an example of the output when used on the two
 attached patches. I used html_dynamic_folds on the 2html.vim patch,
 and additionally html_no_foldcolumn and html_hover_unfold on the
 syntax.txt patch.

 As discussed in the vim_dev thread above, it may be desirable to be
 able to do away with the foldcolumn in the html output, but it was
 hard to determine what to do to allow folds to open and close without
 it. Rather than making the javascript and markup needlessly complex, I
 just used CSS 2.0 :hover selection to open folds on hover if desired
 (though normally, only CSS 1.0 support is required, and a fallback is
 inserted for IE6).

 Please comment!

 -- Ben


That's very nice and useful.  Thanks.
One minor comment.  In syntax.txt, I read:

  If you use this option, it would not be possible to open the folds

I think it should be...

  If you used this option, it would not be possible to open the folds

:s/use/d/

-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: [patch] Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Dominique Pelle

Benjamin Fritz:


 A patch is attached for the behavior discussed in these threads:
 http://groups.google.com/group/vim_use/browse_thread/thread/8532e7236f113ab7/0b508a50b767a1e1
 http://groups.google.com/group/vim_dev/browse_thread/thread/56d5debad6f5f351/44cc7eb3b4787440

 Also attached is an example of the output when used on the two
 attached patches. I used html_dynamic_folds on the 2html.vim patch,
 and additionally html_no_foldcolumn and html_hover_unfold on the
 syntax.txt patch.

 As discussed in the vim_dev thread above, it may be desirable to be
 able to do away with the foldcolumn in the html output, but it was
 hard to determine what to do to allow folds to open and close without
 it. Rather than making the javascript and markup needlessly complex, I
 just used CSS 2.0 :hover selection to open folds on hover if desired
 (though normally, only CSS 1.0 support is required, and a fallback is
 inserted for IE6).

 Please comment!

 -- Ben


I can't apply the patch cleanly unfortunately. There are conflicts.

2html.vim.diff is a patch from a version last changed on 2008 Dec 03

But...

2html.vim in CVS was last changed on 2008 Jul 17  (too old)
2html.vim from ftp contains a version changed on 2009 Jan 13  (too new)

Regards
-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: gVim 7.2 hangs when issuing ':h shortmess' command

2009-01-17 Fir de Conversatie Bram Moolenaar


Valery Kondakoff wrote:

 If there is a 'set encoding=utf-8' line in my _vimrc gVim 7.2 hangs when
 issuing ':h shortmess' command consuming ~50% of CPU usage.
 Can anyone confirm this?
 The ':h shortmess' command works as expected when I'm commenting the
 'set encoding=utf-8' line out and restarting gVim. On the other hand
 gVim hangs on ':h shortmess' when 'set encoding=utf-8' is the only one
 line in _vimrc.
 
 Is this a bug or am I doing smth wrong?
 
 I'm using gVim 7.2 in Win Vista HP SP1.

I don't see this problem (although I don't have Vista).

Does this problem happen for any help tag in options.txt?  Or is it just
this specific command?

You might want to check conversion libraries, iconv.dll or libiconv.dll.
If you have them, temporarily rename them to see what happens

-- 
If someone questions your market projections, simply point out that your
target market is People who are nuts and People who will buy any damn
thing.  Nobody is going to tell you there aren't enough of those people
to go around.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: gVim 7.2 hangs when issuing ':h shortmess' command

2009-01-17 Fir de Conversatie Dominique Pelle

Valery Kondakoff wrote:

 Hi!

 If there is a 'set encoding=utf-8' line in my _vimrc gVim 7.2 hangs when
 issuing ':h shortmess' command consuming ~50% of CPU usage.
 Can anyone confirm this?
 The ':h shortmess' command works as expected when I'm commenting the
 'set encoding=utf-8' line out and restarting gVim. On the other hand
 gVim hangs on ':h shortmess' when 'set encoding=utf-8' is the only one
 line in _vimrc.

 Is this a bug or am I doing smth wrong?

 I'm using gVim 7.2 in Win Vista HP SP1.

 Thanks.


I can't reproduce this with Vim-7.2 neither on Linux, nor
on Windows Vista SP1.

-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: [patch] Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Tony Mechelynck

On 17/01/09 09:48, Dominique Pelle wrote:
 Benjamin Fritz wrote

 A patch is attached for the behavior discussed in these threads:
 http://groups.google.com/group/vim_use/browse_thread/thread/8532e7236f113ab7/0b508a50b767a1e1
 http://groups.google.com/group/vim_dev/browse_thread/thread/56d5debad6f5f351/44cc7eb3b4787440

 Also attached is an example of the output when used on the two
 attached patches. I used html_dynamic_folds on the 2html.vim patch,
 and additionally html_no_foldcolumn and html_hover_unfold on the
 syntax.txt patch.

 As discussed in the vim_dev thread above, it may be desirable to be
 able to do away with the foldcolumn in the html output, but it was
 hard to determine what to do to allow folds to open and close without
 it. Rather than making the javascript and markup needlessly complex, I
 just used CSS 2.0 :hover selection to open folds on hover if desired
 (though normally, only CSS 1.0 support is required, and a fallback is
 inserted for IE6).

 Please comment!

 -- Ben


 That's very nice and useful.  Thanks.
 One minor comment.  In syntax.txt, I read:

If you use this option, it would not be possible to open the folds

 I think it should be...

If you used this option, it would not be possible to open the folds

 :s/use/d/

 -- Dominique

Another possibility is:

If you use this version, it won't be possible to open the folds.

...used...would not... makes it seem that no one would ever use the 
option in question.

(For you Frenchmen, it's the same as between si vous utilisiez cette 
option, il serait impossible d'ouvrir les plis vs. si vous utilisez... 
il sera


Best regards,
Tony.
-- 
Happiness, n.:
An agreeable sensation arising from contemplating the misery of
another.
-- Ambrose Bierce, The Devil's Dictionary

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Ben Fritz



On Jan 17, 5:57 am, Dominique Pelle dominique.pe...@gmail.com
wrote:


 I can't apply the patch cleanly unfortunately. There are conflicts.

 2html.vim.diff is a patch from a version last changed on 2008 Dec 03

 But...

 2html.vim in CVS was last changed on 2008 Jul 17  (too old)
 2html.vim from ftp contains a version changed on 2009 Jan 13  (too new)


Rats, I thought I was safe. I started editing in late December.

I have tried in the past to find the runtime files in ftp...where
would I find the latest one to update my patch?

Alternatively, I could use SVN if the runtime files are up-to-date in
there. It looks like the ones in CVS are not. I would probably prefer
this method, actually.

-- Ben
--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Ben Fritz



On Jan 17, 9:54 am, Ben Fritz fritzophre...@gmail.com wrote:

  I can't apply the patch cleanly unfortunately. There are conflicts.



 I could use SVN if the runtime files are up-to-date in
 there. It looks like the ones in CVS are not. I would probably prefer
 this method, actually.


Thouh, I would need someone to tell me where to find the latest
runtime files in the huge tree in the repository. I've tried browsing
the SVN repo before, and it's a bit overwhelming for someone who's
never worked in it before.
--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Markus Heidelberg

Ben Fritz, 17.01.2009:
 
 On Jan 17, 5:57 am, Dominique Pelle dominique.pe...@gmail.com
 wrote:
 
 
  I can't apply the patch cleanly unfortunately. There are conflicts.
 
  2html.vim.diff is a patch from a version last changed on 2008 Dec 03
 
  But...
 
  2html.vim in CVS was last changed on 2008 Jul 17  (too old)
  2html.vim from ftp contains a version changed on 2009 Jan 13  (too new)
 
 
 Rats, I thought I was safe. I started editing in late December.
 
 I have tried in the past to find the runtime files in ftp...where
 would I find the latest one to update my patch?

Yes, on the FTP server.

 Alternatively, I could use SVN if the runtime files are up-to-date in
 there. It looks like the ones in CVS are not. I would probably prefer
 this method, actually.

SVN has the same content as CVS, i.e. older runtime files.

If you prefer the convenience of a version control system to get the
latest runtime files, you can also use one of my git trees. They are
kept simple and clear and won't add confusion.

http://repo.or.cz/w/vim_mainline.git
branch 'vim-runtime' for merely the latest runtime files
branch 'master' for vim sources + the latest runtime files
or
http://repo.or.cz/w/vim_extended.git
branch 'vim-with-runtime' is the same as 'master' from vim_mainline
Not as simple due to 

Markus


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Markus Heidelberg

Markus Heidelberg, 17.01.2009:
 http://repo.or.cz/w/vim_extended.git
 branch 'vim-with-runtime' is the same as 'master' from vim_mainline
 Not as simple due to 

Oh, an unfinished sentence, while looking for an appropriate word in the
dictionary and digressing. What I wanted to say is, that there are more
branches, so it seems naturally not as simple.

Markus


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Dominique Pelle

Ben Fritz wrote

 On Jan 17, 9:54 am, Ben Fritz fritzophre...@gmail.com wrote:

  I can't apply the patch cleanly unfortunately. There are conflicts.



 I could use SVN if the runtime files are up-to-date in
 there. It looks like the ones in CVS are not. I would probably prefer
 this method, actually.


 Thouh, I would need someone to tell me where to find the latest
 runtime files in the huge tree in the repository. I've tried browsing
 the SVN repo before, and it's a bit overwhelming for someone who's
 never worked in it before.


Try: rsync -avzcP --delete --exclude=dos --exclude=spell
ftp.nluug.nl::Vim/runtime/ .

But I personally do that in another directory than my main vim
directory because it not only pulls new files but also delete files.

I don't know why runtime files are not updated in CVS like source
files.  It would be more convenient.  Or maybe in a separate CVS
module if runtime files are deemed too large.

-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: [patch] Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Benjamin Fritz
New patches attached, against the latest files on the FTP server.

Also fixed a bug due to an interesting quirk of the default fold text:

+-- 35 for 2-digit line counts
+--200 for 3 or more digits in the line count

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



2html.vim.diff
Description: Binary data


syntax.txt.diff
Description: Binary data


(patch) fixed cosmetic alignment bug in :cs help

2009-01-17 Fir de Conversatie Dominique Pelle
Hi,

Attached patch fixes a low priority cosmetic bug.

When doing :cs help, messages are properly aligned
in English but are misaligned on some other languages
when using utf-8 encoding. So it looks ugly.

Misalignment buglet happens in languages which uses
non ASCII characters and happens at least for French
and Esperanto for example because of accentuated
characters.

The problem happens because cs_help() in if_cscope.c
uses %-30s format to align text but %-30s prints
strings on 30 *bytes* rather than 30 characters (or
30 screen cells to be more exact).

Attached patch fixes it.

See screenshot before fix (notice how strings are misaligned):
  http://dominique.pelle.free.fr/pic/align-buglet-eo.png

And after fix (strings correctly aligned):
  http://dominique.pelle.free.fr/pic/align-buglet-eo-fixed.png

Cheers
-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---

Index: if_cscope.c
===
RCS file: /cvsroot/vim/vim7/src/if_cscope.c,v
retrieving revision 1.32
diff -c -r1.32 if_cscope.c
*** if_cscope.c	25 Aug 2008 02:35:59 -	1.32
--- if_cscope.c	17 Jan 2009 22:29:26 -
***
*** 1177,1184 
  (void)MSG_PUTS(_(cscope commands:\n));
  while (cmdp-name != NULL)
  {
! 	(void)smsg((char_u *)_(%-5s: %-30s (Usage: %s)),
!   cmdp-name, _(cmdp-help), cmdp-usage);
  	if (strcmp(cmdp-name, find) == 0)
  	MSG_PUTS(_(\n
  		  c: Find functions calling this function\n
--- 1177,1192 
  (void)MSG_PUTS(_(cscope commands:\n));
  while (cmdp-name != NULL)
  {
! 	char *help = _(cmdp-help);
! 	int sz = vim_strsize((char_u *)help);
! 	int space_cnt = 30 - sz;
! 	if (space_cnt  0)
! 	space_cnt = 0;
! 	/* Use %*s rather than %30s to ensure proper alignment in utf-8 */
! 	(void)smsg((char_u *)_(%-5s: %s%*s (Usage: %s)),
!   cmdp-name,
!   help, space_cnt,  ,
!   cmdp-usage);
  	if (strcmp(cmdp-name, find) == 0)
  	MSG_PUTS(_(\n
  		  c: Find functions calling this function\n


Re: Percentage of File Traversed

2009-01-17 Fir de Conversatie Michael Wookey

 What is the parameter to determine the percentage of file traversed (the one
 that is displayed on the lower right corner) ? Please tell the source file
 also that does it...

Refer to 'statusline' in the documentation -

:help statusline

Specifically, you are after the 'p' item.  For example, to display
only the file percentage and have it right justified -

:set statusline=%=%(%p%%%)

Hope this helps.

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



PATCH: URLs can't be found in 'path'

2009-01-17 Fir de Conversatie Matt Wozniski
:help 'path' says

- When using |netrw.vim| URLs can be used.  For example, adding
  http://www.vim.org; will make :find index.html work.

This, however, does not actually work (and hasn't since vim 6.4.10, at
least).  Attached patch fixes.

~Matt

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---

diff --git a/src/misc2.c b/src/misc2.c
index 76fe2ec..1598b10 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -4696,7 +4696,9 @@ vim_findfile(search_ctx_arg)
 stackp-ffs_filearray_cur = i + 1;
 ff_push(search_ctx, stackp);
 
-simplify_filename(file_path);
+if (!path_with_url(file_path)) {
+simplify_filename(file_path);
+}
 if (mch_dirname(ff_expand_buffer, MAXPATHL)
 	== OK)
 {


Re: [patch] Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Antony Scriven

On Sat, Jan 17, 2009 at 12:56 PM, Tony Mechelynck
antoine.mechely...@gmail.com wrote:

  On 17/01/09 09:48, Dominique Pelle wrote:
   Benjamin Fritz wrote
  
A patch is attached for the behavior discussed in
these threads:
http://groups.google.com/group/vim_use/browse_thread/thread/8532e7236f113ab7/0b508a50b767a1e1
http://groups.google.com/group/vim_dev/browse_thread/thread/56d5debad6f5f351/44cc7eb3b4787440
   
[...]
  
   That's very nice and useful.  Thanks.
   One minor comment.  In syntax.txt, I read:
  
  If you use this option, it would not be possible to
  open the folds
  
   I think it should be...
  
  If you used this option, it would not be possible to
  open the folds
  
   :s/use/d/
  
   -- Dominique
 
  Another possibility is:
 
 If you use this version, it won't be possible to
 open the folds.

(s/version/option/ but this is irrelevant to the discussion.)

  ...used...would not... makes it seem that no one would
  ever use the option in question.

Yes, this is better, but it should be

   If you :let html_no_foldcolumn = 1 it
   won't be possible to open the folds unless
   you use :let html_hover_unfold = 1

or whatever the correct usage is. Alternatively remove
the sentence altogether and say:

   :let html_hover_unfold = 1 will use CSS 2.0 to
   allow a user to open a fold by hovering the mouse
   pointer over it. This is useful when using
   :let html_no_foldcolumn = 1.

--Antony

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Dynamic folding in 2html.vim output

2009-01-17 Fir de Conversatie Ben Fritz



On Jan 17, 7:56 pm, Antony Scriven adscri...@gmail.com wrote:


 Yes, this is better, but it should be

    If you :let html_no_foldcolumn = 1 it
    won't be possible to open the folds unless
    you use :let html_hover_unfold = 1

 or whatever the correct usage is. Alternatively remove
 the sentence altogether and say:

    :let html_hover_unfold = 1 will use CSS 2.0 to
    allow a user to open a fold by hovering the mouse
    pointer over it. This is useful when using
    :let html_no_foldcolumn = 1.


Actually, I was trying to say that html_no_foldcolumn will
automatically set html_hover_unfold. How's this?



Using this option, there will be no foldcolumn available to open the
folds in
the HTML. For this reason, another option is provided:
html_hover_unfold.
Enabling this option will use CSS 2.0 to allow a user to open a fold
by
hovering the mouse pointer over it. Note that old browsers (notably
Internet
Explorer 6) will not support this feature.  Browser-specific markup
for IE6 is
included to fall back to the normal CSS1 code so that the folds show
up
correctly for this browser, but they will not be openable without a
foldcolumn. Note that using html_hover_unfold will allow modern
browsers with
disabled javascript to view closed folds. To use this option, use: 
   :let html_hover_unfold

Setting html_no_foldcolumn with html_dynamic_folds will automatically
set
html_hover_unfold, because otherwise the folds wouldn't be dynamic.


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---