Loading ...
Sorry, an error occurred while loading the content.
 

Re: Items in popup menu

Expand Messages
  • Bram Moolenaar
    ... Where did you get the Select sentence menu entry from? It s not in the standard menus. ... One is to turn the existing selection into a blockwise
    Message 1 of 5 , Dec 3, 2004
      Jens Paulus wrote:

      > when using gvim with the popup menu there is something which could be
      > improved. For example, if I execute the item
      > Select word
      > and directly after this
      > Select sentence
      > the visual mode is left and the sentence is not selected. To select a
      > sentence I have to do it once more.

      Where did you get the "Select sentence" menu entry from? It's not in
      the standard menus.

      > And if I am in visual mode an additional item
      > Select blockwise
      > appears although there is already a
      > Select block
      > item.

      One is to turn the existing selection into a blockwise selection, the
      other to start selecting a block at the cursor position. There is no
      special mode for blockwise Visual mode, thus the entry can't be omitted
      for the situation you already are in that mode.

      > When not using the popup menu I can select a word and then directly
      > switch to linewise selection. With the popup menu it should be the same
      > and I think there is no need to have two items for blockwise selection.
      > More useful would be items for selecting a sentence and a paragraph.

      That would indeed be useful.

      --
      ARTHUR: You are indeed brave Sir knight, but the fight is mine.
      BLACK KNIGHT: Had enough?
      ARTHUR: You stupid bastard. You havn't got any arms left.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    • Jens Paulus
      Hi Bram, ... actually this is true. Instead of Select sentence I meant Select line. The popup menu contains the following items. Undo Paste Select Word Select
      Message 2 of 5 , Dec 3, 2004
        Hi Bram,

        On Fri, Dec 03, 2004 at 12:08:48 +0100, Bram Moolenaar wrote:
        > > when using gvim with the popup menu there is something which could be
        > > improved. For example, if I execute the item
        > > Select word
        > > and directly after this
        > > Select sentence
        > > the visual mode is left and the sentence is not selected. To select a
        > > sentence I have to do it once more.
        >
        > Where did you get the "Select sentence" menu entry from? It's not in
        > the standard menus.

        actually this is true. Instead of Select sentence I meant Select line.
        The popup menu contains the following items.

        Undo
        Paste
        Select Word
        Select Line
        Select Block
        Select All

        Now if I select a word with the popup menu and then directly after this
        a line with the popup menu I am put back into Normal mode instead of
        having the current line selected. My idea is that I am not thrown back
        to Normal mode but that it works like executing vip and after this V in
        Normal mode, the result is that the current line is selected.

        The same is if I use the popup menu to first select a line and then a
        block or first select a word and then a block and so on. Leaving Visual
        mode with the popup menu should only be possible if the same object is
        selected which is currently active, for example selecting a word when
        characterwise visual mode is active or selecting a line in linewise mode
        or selecting a block in blockwise mode. In the other cases the mode
        should change like with the corresponding keyboard commands.

        This would eliminate the need to have an additional item for starting
        blockwise selection.

        Best regards

        Jens
      • Bram Moolenaar
        ... Ah, that is something else. I now understand you meant to say that when Select Line is used while in Visual mode, Vim goes back to Normal mode. Your
        Message 3 of 5 , Dec 4, 2004
          Jens Paulus wrote:

          > On Fri, Dec 03, 2004 at 12:08:48 +0100, Bram Moolenaar wrote:
          > > > when using gvim with the popup menu there is something which could be
          > > > improved. For example, if I execute the item
          > > > Select word
          > > > and directly after this
          > > > Select sentence
          > > > the visual mode is left and the sentence is not selected. To select a
          > > > sentence I have to do it once more.
          > >
          > > Where did you get the "Select sentence" menu entry from? It's not in
          > > the standard menus.
          >
          > actually this is true. Instead of Select sentence I meant Select line.

          Ah, that is something else. I now understand you meant to say that when
          "Select Line" is used while in Visual mode, Vim goes back to Normal
          mode. Your remarks are a bit difficult to understand if you use the
          wrong words.

          The problem is that the ":amenu" command appens CTRL-\ CTRL-G to the
          command for Visual mode. That causes Vim to go back to Normal mode.
          Apparently nobody noticed that this change in ":amenu" had this effect
          on the popup menu.

          Try out this patch:

          --- menu.vim 7 Oct 2004 20:53:27 -0000 1.3
          +++ menu.vim 4 Dec 2004 12:14:31 -0000
          @@ -2,7 +2,7 @@
          " You can also use this as a start for your own set of menus.
          "
          " Maintainer: Bram Moolenaar <Bram@...>
          -" Last Change: 2004 Sep 16
          +" Last Change: 2004 Dec 04

          " Note that ":an" (short for ":anoremenu") is often used to make a menu work
          " in all modes and avoid side effects from mappings defined by the user.
          @@ -785,9 +785,37 @@
          vnoremenu 1.50 PopUp.&Delete x
          an 1.55 PopUp.-SEP2- <Nop>
          vnoremenu 1.60 PopUp.Select\ Blockwise <C-V>
          -an 1.70 PopUp.Select\ &Word vaw
          -an 1.80 PopUp.Select\ &Line V
          -an 1.90 PopUp.Select\ &Block <C-V>
          +
          +nnoremenu 1.70 PopUp.Select\ &Word vaw
          +onoremenu 1.70 PopUp.Select\ &Word aw
          +vnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw
          +inoremenu 1.70 PopUp.Select\ &Word <C-O>vaw
          +cnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw
          +
          +nnoremenu 1.73 PopUp.Select\ &Sentence vas
          +onoremenu 1.73 PopUp.Select\ &Sentence as
          +vnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas
          +inoremenu 1.73 PopUp.Select\ &Sentence <C-O>vas
          +cnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas
          +
          +nnoremenu 1.77 PopUp.Select\ Pa&ragraph vap
          +onoremenu 1.77 PopUp.Select\ Pa&ragraph ap
          +vnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap
          +inoremenu 1.77 PopUp.Select\ Pa&ragraph <C-O>vap
          +cnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap
          +
          +nnoremenu 1.80 PopUp.Select\ &Line V
          +onoremenu 1.80 PopUp.Select\ &Line <C-C>V
          +vnoremenu 1.80 PopUp.Select\ &Line <C-C>V
          +inoremenu 1.80 PopUp.Select\ &Line <C-O>V
          +cnoremenu 1.80 PopUp.Select\ &Line <C-C>V
          +
          +nnoremenu 1.90 PopUp.Select\ &Block <C-V>
          +onoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
          +vnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
          +inoremenu 1.90 PopUp.Select\ &Block <C-O><C-V>
          +cnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
          +
          noremenu <script> <silent> 1.100 PopUp.Select\ &All :<C-U>call <SID>SelectAll()<CR>
          inoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-O>:call <SID>SelectAll()<CR>
          cnoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-U>call <SID>SelectAll()<CR>

          --
          BEDEVERE: And what do you burn, apart from witches?
          FOURTH VILLAGER: ... Wood?
          BEDEVERE: So why do witches burn?
          SECOND VILLAGER: (pianissimo) ... Because they're made of wood...?
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
          \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
        • Jens Paulus
          Hi Bram, ... unfortunately I cannot test it, but it basically looks good. Below are some comments. ... The item Blockwise is not really needed I think because
          Message 4 of 5 , Dec 8, 2004
            Hi Bram,

            On Sat, Dec 04, 2004 at 13:58:37 +0100, Bram Moolenaar wrote:
            > > > > when using gvim with the popup menu there is something which could be
            > > > > improved. For example, if I execute the item
            > > > > Select word
            > > > > and directly after this
            > > > > Select sentence
            > > > > the visual mode is left and the sentence is not selected. To select a
            > > > > sentence I have to do it once more.
            > > >
            > > > Where did you get the "Select sentence" menu entry from? It's not in
            > > > the standard menus.
            > >
            > > actually this is true. Instead of Select sentence I meant Select line.
            >
            > Ah, that is something else. I now understand you meant to say that when
            > "Select Line" is used while in Visual mode, Vim goes back to Normal
            > mode. Your remarks are a bit difficult to understand if you use the
            > wrong words.
            >
            > The problem is that the ":amenu" command appens CTRL-\ CTRL-G to the
            > command for Visual mode. That causes Vim to go back to Normal mode.
            > Apparently nobody noticed that this change in ":amenu" had this effect
            > on the popup menu.
            >
            > Try out this patch:

            unfortunately I cannot test it, but it basically looks good. Below are
            some comments.

            > --- menu.vim 7 Oct 2004 20:53:27 -0000 1.3
            > +++ menu.vim 4 Dec 2004 12:14:31 -0000
            > @@ -2,7 +2,7 @@
            > " You can also use this as a start for your own set of menus.
            > "
            > " Maintainer: Bram Moolenaar <Bram@...>
            > -" Last Change: 2004 Sep 16
            > +" Last Change: 2004 Dec 04
            >
            > " Note that ":an" (short for ":anoremenu") is often used to make a menu work
            > " in all modes and avoid side effects from mappings defined by the user.
            > @@ -785,9 +785,37 @@
            > vnoremenu 1.50 PopUp.&Delete x
            > an 1.55 PopUp.-SEP2- <Nop>
            > vnoremenu 1.60 PopUp.Select\ Blockwise <C-V>

            The item Blockwise is not really needed I think because the item Block
            does the same thing.

            > -an 1.70 PopUp.Select\ &Word vaw
            > -an 1.80 PopUp.Select\ &Line V
            > -an 1.90 PopUp.Select\ &Block <C-V>
            > +
            > +nnoremenu 1.70 PopUp.Select\ &Word vaw
            > +onoremenu 1.70 PopUp.Select\ &Word aw
            > +vnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw

            An alternative would be to use aw instead at the previous line which
            would expand the selection by one additional word.

            > +inoremenu 1.70 PopUp.Select\ &Word <C-O>vaw
            > +cnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw
            > +
            > +nnoremenu 1.73 PopUp.Select\ &Sentence vas
            > +onoremenu 1.73 PopUp.Select\ &Sentence as
            > +vnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas

            An alternative would be to use as instead at the previous line which
            would expand the selection by one additional sentence.

            > +inoremenu 1.73 PopUp.Select\ &Sentence <C-O>vas
            > +cnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas
            > +
            > +nnoremenu 1.77 PopUp.Select\ Pa&ragraph vap
            > +onoremenu 1.77 PopUp.Select\ Pa&ragraph ap
            > +vnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap

            An alternative would be to use ap instead at the previous line which
            would expand the selection by one additional paragraph.

            > +inoremenu 1.77 PopUp.Select\ Pa&ragraph <C-O>vap
            > +cnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap
            > +
            > +nnoremenu 1.80 PopUp.Select\ &Line V
            > +onoremenu 1.80 PopUp.Select\ &Line <C-C>V
            > +vnoremenu 1.80 PopUp.Select\ &Line <C-C>V
            > +inoremenu 1.80 PopUp.Select\ &Line <C-O>V
            > +cnoremenu 1.80 PopUp.Select\ &Line <C-C>V
            > +
            > +nnoremenu 1.90 PopUp.Select\ &Block <C-V>
            > +onoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
            > +vnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
            > +inoremenu 1.90 PopUp.Select\ &Block <C-O><C-V>
            > +cnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
            > +
            > noremenu <script> <silent> 1.100 PopUp.Select\ &All :<C-U>call <SID>SelectAll()<CR>
            > inoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-O>:call <SID>SelectAll()<CR>
            > cnoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-U>call <SID>SelectAll()<CR>

            The patch stops here. The selection expansion may be a good idea or not.

            Best regards

            Jens
          Your message has been successfully submitted and would be delivered to recipients shortly.