Re: Insert Visual mode

2006-04-27 Thread Benji Fisher
On Thu, Apr 27, 2006 at 11:32:59AM -0700, Gerald Lai wrote:
 
 Yes, this may not be a legal way to change modes, but I believe (but have
 not confirmed) many existing scripts rely on C-r= to evaluate
 functions that do change modes in some way. If this is true, this is one
 bug that is relied on heavily by many.
 
 Does anybody else have an opinion on this? :)

 I agree that a change like this might break existing scripts.  I
cannot think of any off hand.

HTH --Benji Fisher


Re: Insert Visual mode

2006-04-26 Thread Benji Fisher
On Wed, Apr 26, 2006 at 02:00:07AM -0600, Eric Arnold wrote:
 On 4/26/06, Gerald Lai [EMAIL PROTECTED] wrote:
 
  Yes, I have seen it, and can reproduce it. I never thought I could find
  a simple test case to illustrate it until now:
 
 fun! InsVis()
   exe normal! \C-wwv
 
 BTW, I don't have to switch windows to get these modes to work.  Simply
normal! V
 
 is enough.
 
   return 

 OK, I see it (in vim 7.0f).  I tried

fun! InsVis()
  normal! v
  return 
endfun

and then from Insert mode,

C-R=InsVis()CR

This mode seems to be similar to Insert mode, but Esc takes me to
Visual mode instead of Normal mode.  AFAICT this is undocumented.

HTH --Benji Fisher


Re: Insert Visual mode

2006-04-26 Thread Bram Moolenaar

Benji Fisher wrote:

 On Wed, Apr 26, 2006 at 02:00:07AM -0600, Eric Arnold wrote:
  On 4/26/06, Gerald Lai [EMAIL PROTECTED] wrote:
  
   Yes, I have seen it, and can reproduce it. I never thought I could find
   a simple test case to illustrate it until now:
  
  fun! InsVis()
exe normal! \C-wwv
  
  BTW, I don't have to switch windows to get these modes to work.  Simply
 normal! V
  
  is enough.
  
return 
 
  OK, I see it (in vim 7.0f).  I tried
 
 fun! InsVis()
   normal! v
   return 
 endfun
 
 and then from Insert mode,
 
 C-R=InsVis()CR
 
 This mode seems to be similar to Insert mode, but Esc takes me to
 Visual mode instead of Normal mode.  AFAICT this is undocumented.

This is a really weird mode, being both in Insert mode and having a
Visual selection.  I think I better prevent this from happening.

-- 
BLACK KNIGHT:  I move for no man.
ARTHUR:So be it!
[hah] [parry thrust]
[ARTHUR chops the BLACK KNIGHT's left arm off]
ARTHUR:Now stand aside, worthy adversary.
BLACK KNIGHT:  'Tis but a scratch.
  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- 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///


Re: Insert Visual mode

2006-04-26 Thread Gerald Lai

On Wed, 26 Apr 2006, Benji Fisher wrote:


On Wed, Apr 26, 2006 at 05:17:01PM +0200, Bram Moolenaar wrote:


Benji Fisher wrote:


This mode seems to be similar to Insert mode, but Esc takes me to
Visual mode instead of Normal mode.  AFAICT this is undocumented.


This is a really weird mode, being both in Insert mode and having a
Visual selection.


I agree.


I think I better prevent this from happening.


No complaints here.  Gerald, I hope you will not miss it! ;)


Nah. Good riddance :) It will actually fix a bug in one of my scripts.

Bram, could you make Vim do

  -- (insert) VISUAL --

instead when it now does

  -- INSERT VISUAL --

?

--
Gerald



Re: Insert Visual mode

2006-04-26 Thread Bram Moolenaar

Gerald Lai wrote:

 On Wed, 26 Apr 2006, Benji Fisher wrote:
 
  On Wed, Apr 26, 2006 at 05:17:01PM +0200, Bram Moolenaar wrote:
 
  Benji Fisher wrote:
 
  This mode seems to be similar to Insert mode, but Esc takes me to
  Visual mode instead of Normal mode.  AFAICT this is undocumented.
 
  This is a really weird mode, being both in Insert mode and having a
  Visual selection.
 
  I agree.
 
  I think I better prevent this from happening.
 
  No complaints here.  Gerald, I hope you will not miss it! ;)
 
 Nah. Good riddance :) It will actually fix a bug in one of my scripts.
 
 Bram, could you make Vim do
 
-- (insert) VISUAL --
 
 instead when it now does
 
-- INSERT VISUAL --

With the weird mode prevented, this should never appear now.  Perhaps I
should offer a reward if you are still able to get it somehow!

-- 
There are 10 kinds of people: Those who understand binary and those who don't.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- 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///


Re: Insert Visual mode

2006-04-25 Thread Benji Fisher
On Sat, Apr 22, 2006 at 11:11:33AM -0700, Gerald Lai wrote:
 From Normal mode, typing i will elicit
 
   -- INSERT --
 
 Then typing C-ov will elicit
 
   -- (insert) VISUAL --
 
 My question is, what keystroke will elicit
 
   -- INSERT VISUAL --
 
 ?

 AFAIK there is no such mode.  Have you seen it?  Or do you think
there should be some such mode?

:help vim-modes

(For the sake of lurkers:  we see -- INSERT --- and so on because we
have 'showmode' set.)

HTH --Benji Fisher