andriyko / sublime-robot-framework-assistant

Robot Framework plugin for Sublime Text3
MIT License
110 stars 43 forks source link

Autocomplete with multiple words duplicates parts of the keyword #165

Closed georgecarstoiu closed 8 years ago

georgecarstoiu commented 8 years ago

Not sure if this is a bug or it was implemented like this because of some technical limitation, but when typing a keyword that consists of multiple words, when starting writing the second word and accepting the suggestion offered by autocomplete, the entire keyword will be inserted, and not only the remaining part.

Example:

  1. Start typing 'Set test' ----> you will receive several suggestions
  2. Select first suggestion ----> line will become 'Set Set Test Variable' instead of 'Set Test Variable'
aaltat commented 8 years ago

This is how Sublime Text works. The space character is by default configured as word separator and when keyword is completed then the Sublime Text will complete the word after the cursor.

Yo can change the word separator in the user configurations, also the plugin has it's own word_separators setting in the Robot.sublime-settings file. You can take the space out from the setting, but remember that the word separator affects many things and the side affects might cause more problems than you try to solve.

As a best solution the problem is to write Sett and select the correct completion. Also remember that plugin will search keywords based on the regex (behind the scenes) so: Settand Stest are also valid search patters for the same keyword.

georgecarstoiu commented 8 years ago

I don't think I will mess with the word_separator. No point in possibly breaking something for this small thing.

Thanks for the hint with the regex -> will definitely use it.

We can close this. Thanks for the support!

aaltat commented 8 years ago

Perhaps it would good to mention that in the documentation that completion list of keywords and variables is actually searched on regex so that it is not required to type all the characters from the keyword.