It is currently Thu Nov 26, 2020 1:56 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [Request] Limit AutoComplete-Suggestions
PostPosted: Fri Oct 09, 2020 5:04 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 6:41 pm
Posts: 1364
I have a large module SDL (viewtopic.php?f=14&t=76052)

when i write in the IDE the Prefix "SDL::" it adds hundreds of entries in the suggestion-box and the IDE hang a little bit - really annoying.

in autocomplete.pb
Code:
          ; add items and find the closest item to select
          ClearGadgetItems(#GADGET_AutoComplete_List)
          SelectElement(AutoCompleteList(), AutoComplete_Start)
         
          Repeat
            AddGadgetItem(#GADGET_AutoComplete_List, -1, AutoCompleteList())
          Until ListIndex(AutoCompleteList()) = AutoComplete_End Or NextElement(AutoCompleteList()) = 0
         


should be changed to
Code:
         #maxLimitAutoComplete = 50

         ; add items and find the closest item to select
          ClearGadgetItems(#GADGET_AutoComplete_List)
          SelectElement(AutoCompleteList(), AutoComplete_Start)

         If AutoComplete_End - AutoComplete_Start > #maxLimitAutoComplete
           AutoComplete_End = AutoComplete_Start + #maxLimitAutoComplete
         endif
         
          Repeat
            AddGadgetItem(#GADGET_AutoComplete_List, -1, AutoCompleteList())
          Until ListIndex(AutoCompleteList()) >= AutoComplete_End Or NextElement(AutoCompleteList()) = 0 ; i think >= is more "secure" than "="
         


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye