Re: Bug: Command-line not always erased by :echo

2009-04-04 Fir de Conversatie Bram Moolenaar


Tony Mechelynck wrote:

 :echo apparently erases only part of the command-line in some 
 circumstances.
 
 After defining the following function
 
   function TestForX()
   let @+ =  
   let x = @+
   let @+ = '--' . x
   redir @
   silent reg
   redir END
   let @+ = x
   return (@ =~ '\n+ ')
   endfunction
 
 (which actually tests, not for X but for clipboard usability),
 
   :echo TestForX()
 
 returns either :echo TestF0 or :echo TestF1.  This problem is 
 apparently only cosmetic, since
 
   :if TestForX()|echo 'yes'|else|echo 'no'|endif
 
 returns :if TestForyes or :if TestForno, not always the same string.
 
 So, for some reason, if that function was used, :echo does not erase 
 the first 11 characters on the command-line.
 
 If it makes any difference, my 'cmdheight' is set to 2 and I tested this 
 using a Huge Vim 7.2.148 for GTK2/Gnome2 in console mode on Linux, both 
 in konsole (where it takes the true branch of the above :if) and in 
 the Linux console (where it takes the else branch)...

I see the problem.  When redirecting silently the message column is
still advanced and it's never reset.  Not avancing the column causes
trouble for some lists, so the solution will be to reset the column
after the command is done.

-- 
   GALAHAD turns back.  We see from his POV the lovely ZOOT standing by him
   smiling enchantingly and a number of equally delectable GIRLIES draped
   around in the seductively poulticed room.  They look at him smilingly and
   wave.
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// 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
-~--~~~~--~~--~--~---



Proposed correction to one helpfile

2009-04-04 Fir de Conversatie Tony Mechelynck
I suggest the attached help patch about editing the cmdline-window.

Best regards,
Tony.
-- 
But don't you worry, its for a cause -- feeding global corporations
paws.

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

*** ../vim72/runtime/doc/cmdline.txt	2009-03-22 20:39:46.0 +0100
--- runtime/doc/cmdline.txt	2009-04-04 09:12:45.0 +0200
***
*** 973,980 
  
  EDIT
  
! You can now use commands to move around and edit the text in the window.  Both
! in Normal mode and Insert mode.
  
  It is possible to use :, / and other commands that use the command-line,
  but it's not possible to open another command-line window then.  There is no
--- 973,982 
  
  EDIT
  
! You can now use commands to move around and edit the text in the window, both
! in Normal mode and Insert mode. However, any changes you make there are not
! permanent: they are not reflected in the command-line history, and once you
! leave the command-line window, they are lost.
  
  It is possible to use :, / and other commands that use the command-line,
  but it's not possible to open another command-line window then.  There is no


doc suggestion

2009-04-04 Fir de Conversatie Yakov Lerner
If vimscript functions had remark Added in vim7.1.129, it would be useful.
For example, if you want to know how portable the script is.

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



Re: doc suggestion

2009-04-04 Fir de Conversatie Matt Wozniski

On Sat, Apr 4, 2009 at 3:17 PM, Yakov Lerner wrote:

 If vimscript functions had remark Added in vim7.1.129, it would be useful.
 For example, if you want to know how portable the script is.

Probably not exactly what you're looking for, but I keep copies of vim
6.4.10 and 7.0.0 around just so that I can look at older runtimefiles
and docs and test scripts in older vims.

~Matt

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



Re: doc suggestion

2009-04-04 Fir de Conversatie Ingo Karkat

On 04-Apr-09 22:21, Matt Wozniski wrote:
 On Sat, Apr 4, 2009 at 3:17 PM, Yakov Lerner wrote:
 If vimscript functions had remark Added in vim7.1.129, it would be useful.
 For example, if you want to know how portable the script is.
 
 Probably not exactly what you're looking for, but I keep copies of vim
 6.4.10 and 7.0.0 around just so that I can look at older runtimefiles
 and docs and test scripts in older vims.
 
 ~Matt

I keep old Vim versions (since 6.0), too, and grep the docs for the first 
occurrence of a built-in function name. (But I also use these old Vims for 
compatibility testing of my scripts.) I totally agree with Yakov that this 
would 
be very helpful for script writers. I'd love to see these remarks below each 
function's help text, with a formatting similar to those {not in Vi} and {not 
available when compiled without the +whatever feature} remarks, e.g. {since 
7.0} 
or {optional third argument added with 7.1.42}.

Manually researching this for all built-in functions looks tedious, but maybe 
someone can come up with a throwaway script that extracts the relevant info 
from 
the patch info / CVS history / git / ...?

-- regards, ingo


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



Re: Proposed correction to one helpfile

2009-04-04 Fir de Conversatie Tony Mechelynck

On 04/04/09 19:21, Tony Mechelynck wrote:
 I suggest the attached help patch about editing the cmdline-window.

 Best regards,
 Tony.

oops, I didn't scroll far enough. Forget it (or maybe not, if it's worth 
adding the same warning about one screen height or so upward of where it 
already is).

Best regards,
Tony.
-- 
Brain, n.:
The apparatus with which we think that we think.
-- 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: doc suggestion

2009-04-04 Fir de Conversatie Tony Mechelynck

On 04/04/09 21:17, Yakov Lerner wrote:
 If vimscript functions had remark Added in vim7.1.129, it would be useful.
 For example, if you want to know how portable the script is.

The docs are there, it just may be a little esoteric to find them.

:helpgrep \foobar(

or maybe, to narrow down the search,

:vimgrep /\foobar(/g $VIMRUNTIME/doc/version*.txt

will search, in the former case the text of all help files, or in the 
latter case only that of the version*.txt helpfiles, for any mentioon of 
the  foobar() function. If it was added to Vim not earlier than version 
4.0, you'll find at exactly at which version and patchlevel that happened.

If you find out that it was introduced at version 6.3.87 you can test 
for it by either

if exists('*foobar')

or

if version  603 || (version == 603  has('patch087'))

The latter is useful if, at some point after introducing the function, 
an important bug in it (that you care about) was fixed.

If some version of Vim 3 already had the function (i.e. it was already 
there as other than a new feature in Vim 4.0.000), then I suppose you 
can say by now that it's been there forever, and the only case when 
you might still be unable to use it is if you use a non-feature-complete 
Vim lacking some optional feature which includes that function. Of 
course, -eval versions include no functions at all.


Best regards,
Tony.
-- 
The only really decent thing to do behind a person's back is pat it.

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



Re: doc suggestion

2009-04-04 Fir de Conversatie George V. Reilly

On Sat, Apr 4, 2009 at 5:31 PM, Tony Mechelynck
antoine.mechely...@gmail.com wrote:

 If some version of Vim 3 already had the function (i.e. it was already
 there as other than a new feature in Vim 4.0.000), then I suppose you
 can say by now that it's been there forever, and the only case when
 you might still be unable to use it is if you use a non-feature-complete
 Vim lacking some optional feature which includes that function. Of
 course, -eval versions include no functions at all.

VimL scripting was introduced in Vim 5.0, eleven years ago, according
to http://en.wikipedia.org/wiki/Vim_(text_editor)#History. Personally,
I wouldn't expend more than a few minutes ensuring compatibility with
Vim 6.0 (2001), especially if you need dictionaries and other 7.0
features.

I think it's a mistake to continue supporting users who run really old
versions of Vim or really old operating systems. Their numbers are
dwindling and supporting them has real costs in terms of testing and
code complexity. Look at the horrendous amounts of conditional code in
the C source. If they don't want to upgrade (or can't), they'll have
to accept limitations. They certainly have to from other programs.
-- 
/George V. Reilly  geo...@reilly.org
http://www.georgevreilly.com/blog  http://blogs.cozi.com/tech

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