pycoverage.el
pycoverage.el copied to clipboard
pycoverage adds "space" when activating region
When using pycoverage (after a my-coverage
call), somehow whenever I mark something, the cursor jumps around (adding a space).
When turned off transient-mark-mode
the problem disappears, but I cannot see the region. When I turn it back on, then the problem is still there.
It really makes it unusable :( Note that it only happens after a couple of times using pytest
with --cov
in emacs, and a couple of times of my-coverage. It's unfortunately persisting across new boot.
Have you seen something like this?
Added a screenshot, where you can see the letter "i" that's marked has moved one space to the right. It was indented just fine. When I stop the region, it jumps back to its place.
I see the same or a similar problem whenever I edit covered filed (i.e. the coverage becomes outdated). I happen to use git-gutter-mode and do not have linum-mode enabled globally. The problem disappears (but git-gutter breaks) if I use (git-gutter:linum-setup) instead of enabling it globally.
The problem also disappears if I add a fallback condition to pycoverage-line-format as follows:
(defun pycoverage-line-format (linenum)
(cond
((member linenum pycoverage-data)
(propertize "❌" 'face '(:background " " :foreground "red")))
(pycoverage-data
;; covered data
(propertize "✓" 'face '(:background " " :foreground "green")))
(t (propertize "0" 'face '(:background "grey" :foreground " ")))))
(I added the characters and changed the configuration a bit to make the three cases visually more distinguished.)
@kootenpv do you have a similar setup and does my change help in your case?
@TauPan Just wondering... what would be the fix without colourization? I'd be glad to give it a try.
Just the final t clause in the cond. I can post code later.
Pascal van Kooten [email protected] schrieb am Do., 5. Apr. 2018, 15:39:
@TauPan https://github.com/TauPan Just wondering... what would be the fix without colourization?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mattharrison/pycoverage.el/issues/6#issuecomment-378939319, or mute the thread https://github.com/notifications/unsubscribe-auth/AARrPUsBwRF-lKR7G-Zq2Uf0q0cF11j2ks5tlh6ZgaJpZM4Kkf1_ .