-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
weird cursor issues #290
Comments
This way the cursor is contrasted better with the region, which means that when it overlaps, it is still visible. Closes: bbatsov#290
hopefully #291 will fix this by using a stronger color for the cursor. |
another approach i'd consider for this would be to make the cursor face customizable. i'd like, for example, to be able to pick a color like i know this possibly opens a pandora's box, but can we make at least some faces customizable? |
Some face properties have defcustoms already. |
Doesnt emacs use a blinking cursor by default to make it clear where the active current cursor is located? I even have different cursor colors to highlight different modes but thats not handeled by the theme at all.. Since I use region-bindings-mode I have a special cursor when a region is active so that I know which bindings are active.... ;; Settings that might have been set by loading libraries
;; use-package frame.el
(setq-default blink-cursor-mode t
blink-cursor-interval 0.6
cursor-type 'bar)
(blink-cursor-mode)
(defun cursor-style-update-action ()
(when (bound-and-true-p cua-normal-cursor-color)
(let* ((current-cursor-color (cdr (assq 'cursor-color (frame-parameters))))
(cursor-style (cond
((bound-and-true-p region-bindings-mode) (list "#d33682" '(bar . 8) t))
((bound-and-true-p god-local-mode) (list "#268bd2" 'box nil))
((bound-and-true-p buffer-read-only) (list "#859900" 'box nil))
(t (list cua-normal-cursor-color my-normal-cursor-type t)))))
(unless (equal (nth 0 cursor-style) current-cursor-color)
(set-cursor-color (nth 0 cursor-style)))
(unless (equal (nth 1 cursor-style) cursor-type)
(setq cursor-type (nth 1 cursor-style)))
(unless (equal (nth 2 cursor-style) blink-cursor-mode)
(blink-cursor-mode (or (nth 2 cursor-style) -1))))))
(defvar cursor-style-timer nil)
(defun cursor-style-update ()
(when cursor-style-timer
(cancel-timer cursor-style-timer))
(setq cursor-style-timer
(run-with-idle-timer 0.2 nil 'cursor-style-update-action)))
(hook-into-modes 'cursor-style-update
'(activate-mark-hook
deactivate-mark-hook
region-bindings-mode-hook
window-configuration-change-hook
minibuffer-setup-hook
minibuffer-exit-hook
god-mode-enabled-hook
god-mode-disabled-hook
god-local-mode-hook
read-only-mode-hook
after-change-major-mode-hook
focus-in-hook
focus-out-hook
))
(defadvice hardhat-local-hook (after cursor-style-update activate)
(cursor-style-update))
|
A video preview of my cursor config... https://youtu.be/EAIH0TdxzRA |
It makes it clearer, but not clear enough to my taste. Beyond, I disabled the blinking cursor here and I think it's reasonable to support that configuration as well. |
So #291 was closed and I'm not sure what the way forward is here: are you saying that the cursor should be a defcustom? How about having the possibility of flipping back and forth between light and dark while keeping meaningful customization? |
Idk. we could have an |
what i would really like is the possibility of setting the cursor to an arbitrary solarized color (e.g. "red") and have it switch correctly when i select the dark or light theme (e.g. |
one thing I have tried is doing a |
okay - here's another proposal: how about we make the cursor and region look different? right now, cursor is: Line 270 in 7c91f48
and region is: Line 309 in 7c91f48
I have found I have better results with:
Does that make sense? |
I don't think that it might skew the intended solarized normal contrasts but I'll try it and see what happens.. Regarding the customization.. If the theme fails to pick it up on emacs start up maybe the theme is loaded before the customization is set in your init file? |
I'm not sure what you mean here, but i must say that i feel it looks much better. The region looks a little more toned down than before and contrasts better with the cursor. Looking back at the original solarized page I wonder if selection areas shouldn't be using base2/base02 instead, however... It looks like that was reserved for the secondary selection though, so I guess that makes sense as well...
i am not sure what's happening with that... I have a very old .emacs file, created before themese were even a thing, so I may doing something wrong. At the end of the
And that's where the theme is configured. First there's something like:
And then at the end of that same file, the faces are set:
At startup, the Not sure wth is going on here... |
I thought that you had created a new defcustom in |
The contrast ratio is too low with that region face.. I think you currently have to either use a complicated solution like i do to change the cursor depending on context or just use the default blinking cursor. We try to support as much as possible but if you want less common configuration combinations you probably have to do some work yourself to make it nice. |
well... a "low contrast ratio" beats "no contrast ratio at all" IMHO. i'd be happy to use a slightly more complicated solution, but i think this should be fixed in solarized-emacs itself. a non-blinking cursor is the default behavior in Emacs, AFAICT, and it should be supported... besides, from what i can tell your solution doesn't adapt to the two solarized styles: it assumes you're in "light" or "dark" mode and does not adapt the cursor depending on which one is enabled. it just hardcodes a color. in that sense, why not just change the color to #859900 or whatever color you picked for one of those modes instead of the ambiguous default? :) thanks for the feedback! |
Blinking cursor is the default |
sorry, got confused there. |
I have been thinking about the idea to provide one or more additional add on packages to solarized theme which set up related stuff which a theme by itslef can't do but I havent found the time do do it.. |
Some of it is tagged with the solarized-config label solarized-config .. not sure if all of it is still up to date. Some suggestions are in the readme.md file as well. |
yeah, it'd be quite useful to have a few more knobs there... i still think my proposed color changes would improve on the default situation though... it seems strange to have the same color for the cursor and the region, in general, no? |
Yes it's strange but the solarized palette doesn't give us many options to choose from if we want to keep the fg/bg contrast ratio at the desired level.. Basically the only proper combinations are base0 on base03 OR base 1 on base02 OR any accent color on base0.. The accent colors are used everywhere so defaulting the cursor to one of them can cause a lot of problems. |
Since Emacs is more or less infinitely customizable the user can almost always enforce any new behaviour by themselves. |
And there is another solarized theme for emcas which has a more heavy and pronounced look for those who wants that. |
Well, I've had problems trying to override cursor-faces, so this is why I am trying to fix this directly in the theme.
Yep, I have tried that one and patched it and worked with it for a long time, but never got anywhere. And it doesn't have the light/dark version. Yours is much better and, so far, the cursor issue is the only one I have found, which is an amazing improvement.
yeah well, I'm not sure how to deal with that, but the patch I proposed works very well here. I'm not sure i understand what contrast issue you are refering to, in fact... |
I see that emacs-24 got a new face spec: New face spec attribute :distant-foregroundspecifies foreground to use if background color is near the foreground that could maybe work... |
any update here? what's the next step? i keep on patching this with #291 here which works well... |
For what it's worth, I traced that behavior back to the Otherwise I'm truly wondering how I should try and fix this bug in the future. You suggested using |
So I really enjoy this mode. I used to use the official one, but I had to patch it to make it do what i need and it wouldn't support light mode. This one just works, so first congrats on that, good job. :)
A weird thing that happens here though is that the cursor disappears when i select backwards. It's a little hard to explain so hopefully a screenshot will help?
This is a normal string of digits, with the cursor at the beginning:
I hit c-space and move the cursor left, the first character is selected:
You can already see the first problem: because there's no distinction between the cursor color and the selection color, it seems that two characters (
12
) are selected, when in fact, only one is selected (1
). Let's try this backwards now. Clear the mark and go to the end of line:Right. Then let's do c-space again and move the point one character to the left:
Heeey what happened to my cursor! It disappeared!?
That's not so great... now the last character is selected, but there's no visual feedback at all.
This is all quite confusing: I think it would help tremendously if the cursor and the region would have slightly different colors.
I probably noticed this only because I was experimenting with a blinking cursor and recently went back to a fixed one...
Am I the only one seeing this?
The text was updated successfully, but these errors were encountered: