| Author | 
                
                  Topic   | 
                  | 
              
              
                | 
                 AdrianS 
                Senior Member 
                    
                 
                
                Canada 
                31 Posts  | 
                
                  
                    
                      
                       Posted - Oct 02 2009 :  08:12:02 AM
                        
                        
                      
  | 
                     
                    
                       Is it my imagination or has the order that snippets are chosen from the Insert VA Snippet menu changed when a hot key is used?
  For example: * select some C++ code * Alt+S to open the Inert Snippet menu * type t
  In my menu, the C++ try/catch snippets appear above the MFC TRY/CATCH snippet and all have a t hot key. The TRY/CATCH is inserted by the above example. My recollection is that, prior to 1736, the first menu item with a particular hot key was used, rather than the last. | 
                     
                   
                 | 
              
              
                | 
                 feline 
                Whole Tomato Software 
                      
                 
                
                United Kingdom 
                19250 Posts  | 
                
                  
                    
                      
                       Posted - Oct 02 2009 :  2:29:33 PM
                        
                        
                      
  | 
                     
                    
                      |  Do you have any idea what version of VA you used to use?  I am seeing the same behaviour you describe, but I am also seeing it in VA 1731 and VA 1727.  If this is a regression then it is a higher priority bug, so it would be useful to find out one way or the other. | 
                     
                    
                        zen is the art of being at one with the two'ness | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 AdrianS 
                Senior Member 
                    
                 
                
                Canada 
                31 Posts  | 
                
                  
                    
                      
                       Posted - Oct 02 2009 :  3:15:48 PM
                        
                        
                      
  | 
                     
                    
                       I'm pretty sure that it was choosing the first hot key item in 1735.  However, I rolled back to 1735 and it's now choosing the last item. Either my memory is faulty or something has changed in the setup after 1736 was installed.  I'm seeing the same effect on two systems.
  I'm pretty sure that it did select the first item in 1735, though, because I use Alt+S then hot key to insert comment blocks and the comments from mid September are the correct snippet.
  It's not a major problem, since I can work around it by reordering my snippets. | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 feline 
                Whole Tomato Software 
                      
                 
                
                United Kingdom 
                19250 Posts  | 
                
                  
                    
                      
                       Posted - Oct 03 2009 :  2:09:04 PM
                        
                        
                      
  | 
                     
                    
                       I have put a bug report in for this, since as you say, we both expect the first item with "t" underlined to be selected and inserted:
  case=33154 | 
                     
                    
                        zen is the art of being at one with the two'ness | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 AdrianS 
                Senior Member 
                    
                 
                
                Canada 
                31 Posts  | 
                
                  
                    
                      
                       Posted - Jan 28 2010 :  06:12:36 AM
                        
                        
                      
  | 
                     
                    
                       Is it just me or has this behaviour changed yet again.  I see no mention of this topic or the case in the change history, though.
  As before, if multiple snippets start with the same letter, they all get the same accelerator. Now, instead of the last snippet being chosen by the accelerator, the menu selection just cycles through the snippets.  To see what I mean, try my original example from the beginning of this topic.
  At least one extra keystroke is now required, and that key (Enter) is at the opposite end of the keyboard from Alt+S.
  Perhaps what is needed is a way to define what accelerator, if any, a snippet should get. Or, at least a way to suppress the accelerator for a snippet. | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 feline 
                Whole Tomato Software 
                      
                 
                
                United Kingdom 
                19250 Posts  | 
                
                  
                    
                      
                       Posted - Jan 28 2010 :  6:17:06 PM
                        
                        
                      
  | 
                     
                    
                       I can confirm the change of behaviour, I am seeing the same change here.
  I am not sure what to say about this.  The normal method for specifying the accelerator is to use & in the string.  But adding & to the shortcuts or bodies of VA snippets is going to cause problems.  We might have to add an extra field for every snippet for the keyboard shortcut in the menu.  Personally I dislike this, since the menu behaviour is likely to change quite a lot when you add the first accelerator.
  The list of all possible VA Snippets is not ideal for quick keyboard access, since the list can be quite long.  This is why the Snippets have shortcuts, for direct access with the keyboard. | 
                     
                    
                        zen is the art of being at one with the two'ness | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sean 
                Whole Tomato Software 
                      
                 
                
                USA 
                2817 Posts  | 
                
                  
                    
                      
                       Posted - Jan 28 2010 :  8:37:53 PM
                        
                        
                      
  | 
                     
                    
                       Yes this changed.  The insert menu now behaves like a standard Win32 menu in that multiple items with the same mnemonic are cycled through - instead of a commit on an arbitrary (first or last) hit.
  In addition, tab will now commit the selected item.  Still an extra keystroke, but on the same side as your Alt+S.
  This changed independently of case=33154 for other reasons.
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 AdrianS 
                Senior Member 
                    
                 
                
                Canada 
                31 Posts  | 
                
                  
                    
                      
                       Posted - Jan 29 2010 :  10:12:30 AM
                        
                        
                      
  | 
                     
                    
                       feline:  quote: This is why the Snippets have shortcuts, for direct access with the keyboard.
   In this case, the snippets that I'm trying to access all include selections.
  For now, I'm going to either add an extra letter (e.g. 'x') to the beginning of the title for snippets that I don't want accelerator access to to or I'll add a number to the beginning.
  sean:  quote: behaves like a standard Win32 menu
   I realize that, but in most cases one has more control over what the accelerators are so the cycling can be avoided.
  Thanks for the Tab suggestion - that will help | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 support 
                Whole Tomato Software 
                      
                 
                
                5566 Posts  | 
                
                  
                    
                      
                       Posted - Feb 18 2010 :  12:55:39 PM
                        
                        
                      
  | 
                     
                    
                      |  case=33154 is fixed in build 1812 | 
                     
                    
                        Whole Tomato Software, Inc. | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                |   | 
                
                  Topic   | 
                  |