Spyder: Current line coloring not working when there are cells in the file

Created on 18 Mar 2015  路  7Comments  路  Source: spyder-ide/spyder

This bug was not present in the first cell-highlighting PR.

Editor Bug v4.2.0

Most helpful comment

I encountered this problem, and I found where it comes from.
The problem is here, the order of .items() is not determined. so depending on the order some highlights will be above others. This bug is random, that's why it can appear to be fixed.

To fix this it is necessary to determinate a fixed order of the keys, either alphabetically (simpler) or by adding a z-index property (more flexible).

I discovered it while working on the vim plugin and I guess that other plugin will want to add their own markers, so the order can not simply defined for the existing keys only.

All 7 comments

I reworked a lot of the logic about cells during the 2.3 series, so I'll take a look at this one :-)

This is working fine for me in master. Could you test again and post an screenshot if the problem persists?

I had an issue with this as well, i.e. the whole cell was highlighted during scrolling in the file instead of just the current line, but is gone after updating to 2.3.4.

It works for me with master

Closing @SylvainCorlay?

Since there are already three confirmations that things are working well, I'm closing this issue.

@SylvainCorlay, please reopen it if the problem appears again :-)

I encountered this problem, and I found where it comes from.
The problem is here, the order of .items() is not determined. so depending on the order some highlights will be above others. This bug is random, that's why it can appear to be fixed.

To fix this it is necessary to determinate a fixed order of the keys, either alphabetically (simpler) or by adding a z-index property (more flexible).

I discovered it while working on the vim plugin and I guess that other plugin will want to add their own markers, so the order can not simply defined for the existing keys only.

This now refers to https://github.com/spyder-ide/spyder/blob/master/spyder/plugins/editor/widgets/base.py#L173

Could we use an OrderedDict to fix this?

Was this page helpful?
0 / 5 - 0 ratings