Re: Contextual Copy is far from Cut and Paste

Emmanuel Briot <[email protected]> Thu, 19 Sep 2013 10:07:10 +0200
Newsgroups gmane.comp.ide.gps.user
Message-ID <[email protected]>
> I just try to use GPS and see that in the contextual menu Cut and Paste items is together, but Copy item is at the another part of contextual menu. Every editors have this 3 items together. I think they should be in upper part.
> 
> Is it going to be changed ?


This issue does not reproduce on the current development version.
The contextual menu for Copy/Paste/Cut is done via a plugin copypaste.py.

I think the issue might have been in that plugin, when the contextual menus 
are created near the end.
They use some invalid "ref".

Here is the current extract of the code if you want to try:


      GPS.Contextual("Cut in editor").create(
          on_activate=on_cut,
          filter=on_source_editor_area,
          group=-1,
          visibility_filter=on_area,
          label=lambda x: "Cut")
      GPS.Contextual("Copy in editor").create(
          on_activate=on_copy,
          filter=on_source_editor_area,
          group=-1,
          visibility_filter=on_area,
          label=lambda x: "Copy",
          ref="Cut",
          add_before=False)
      GPS.Contextual("Paste in editor").create(
          on_activate=on_paste,
          group=-1,
          filter=gps_utils.in_editor,
          label=lambda x: "Paste",
          ref="Copy",
          add_before=False)

      if GPS.Preference("Plugins/copy paste/copy_with_line_nums").get():
          GPS.Contextual("Copy with line numbers").create(
              on_activate=copy_with_line_numbers,
              filter=on_source_editor_area,
              group=-1,
              visibility_filter=on_area,
              ref="Cut")

      GPS.Contextual("sep_group_in_editor").create(
          on_activate=None,
          group=-1,
          filter=gps_utils.in_editor,
          ref="Paste",
          add_before=False)



regards
Emmanuel