Fork me on GitHub
#spacemacs
<
2019-11-17
>
cjsauer13:11:08

Whoa...I’ve also never noticed those. That’s good to know.

practicalli-johnny16:11:40

I am considering a change to the spacemacs-light/dark themes to make them a little more noticeable. I dont yet understand where the bitmap for the indicators come from. I would like something more like the git fringe indicators. You can easily switch off the fringes if they are annoying you 🙂

Jcaw16:11:50

The colors are hard-coded by cider, so contrast will be inconsistent between themes.

(defface cider-fringe-good-face
  '((((class color) (background light)) :foreground "lightgreen")
    (((class color) (background dark)) :foreground "darkgreen"))
  "Face used on the fringe indicator for successful evaluation."
  :group 'cider)
Would probably be better to inherit from the diff face or something.

Jcaw16:11:35

The bitmap appears to be the inbuilt empty-line fringe bitmap. You can check with (fringe-bitmaps-at-pos (point))

Jcaw16:11:33

It seems to be a property added to the fringe, in this method:

(defconst cider--fringe-overlay-good
  (propertize " " 'display '(left-fringe empty-line cider-fringe-good-face))
  "The before-string property that adds a green indicator on the fringe.")
The process seems to be: add a space to the fringe, propertized with this bitmap.

Jcaw16:11:54

Just tested. Modifying empty-line there works.

Jcaw16:11:09

Now have a red curly arrow evaluation indicator, looks gross lol

practicalli-johnny16:11:18

Thanks this is really helpful. I did change the colour via the spacemacs.common.el theme file, but its changing the bitmap I think makes more of a difference.

Jcaw16:11:05

No worries. I'll extract the colors only and put together a PR. Didn't realise spacemacs-theme also overrides the face.

practicalli-johnny16:11:50

At line 265 of spacemacs-comon.el I added as a test the following code...

`(cider-fringe-good-face ((,class (:foreground ,darkpurple))))

practicalli-johnny17:11:51

PR's are awesome.... did you find a nice bitmap to use? Is it possible to use a solid line rather than the empty-line bitmap?

Jcaw17:11:19

I had a look through a few, nothing that I prefer yet. There is a vertical rectangle, but it doesn't fill the frame.

Jcaw17:11:36

Might be possible to bypass the bitmap and just fill the background. Let me try in fact...

Jcaw17:11:59

Yep, that works.

Jcaw17:11:02

(set-face-attribute 'cider-fringe-good-face nil :foreground "red" :background "red")

Jcaw17:11:10

Probably a better approach in this case would be to dispense with the bitmap and just adjust the background, but it might distort on large fringes. Not sure what setups people use.

practicalli-johnny17:11:25

spacemacs defaults to 8 px and there is a fringe-mode to set it to half size. I would be surprised if anyone used more than 16

Jcaw17:11:30

Inheriting from diff-added is nice

Jcaw17:11:18

Can't alter the background without introducing extra logic

Jcaw17:11:24

The logic might not generalise to all themes

practicalli-johnny17:11:06

wonder if we could have a cider layer option that would allow you to choose your bitmap?

Jcaw17:11:26

I was thinking about that. I don't know what Cider's philosophy is on adding extra toggles

Jcaw17:11:12

filled-rectangle, inheriting face from diff-added

practicalli-johnny17:11:46

initial feedback from cider team was it should be a theme configuration

practicalli-johnny17:11:59

I like the last image... filled-rectangle

Jcaw17:11:31

Me too. It's a lot clearer, still seems mostly unobtrusive.

Jcaw17:11:25

If inheriting, some themes have less green diff faces. Zenburn:

Jcaw17:11:18

And some will have more complex faces. Leuven:

Jcaw17:11:22

Probably worth throwing these up on the GitHub issue

Jcaw17:11:31

I'll do that in a bit

Jcaw17:11:13

Ok - putting it all together now.