Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra selections should be ordered #3859

Closed
pwoosam opened this issue Dec 19, 2016 · 2 comments
Closed

Extra selections should be ordered #3859

pwoosam opened this issue Dec 19, 2016 · 2 comments

Comments

@pwoosam
Copy link
Contributor

pwoosam commented Dec 19, 2016

Description of your problem

This is more of a suggestion:

Extra selections dict in base.py is a dictionary, but an OrderedDict may be a better option.
Using an ordered dictionary would allow some selections to take precedence over others, ensuring that the last selection added to extra selections is the one which is highlighted.

This would be a solution to issue 7 in spyder-vim.

Versions and main components

  • Spyder Version: latest
  • Python Version: 3.5.2
  • Operating system: Windows 10
@pwoosam
Copy link
Contributor Author

pwoosam commented Dec 19, 2016

Here is somewhere in Spyder where the same issue occurs:

Steps:

  1. Search for a word which is a part of another word (selection)
  2. Place the cursor on the larger word (extra_selections)

This may or may not occur since the dictionary is unordered. Just restart Spyder and repeat the steps.
find
error

Expected:

The smaller string's extra selection should be given priority over the larger string's selection.
correct

@ccordoba12
Copy link
Member

Please go for it. We're glad to receive a PR for this and also improve the state of spyder-vim :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants