Set Atom cursor to font size, not line height


#1

Hello…
I’m new in using this wonderfull text editor. I’m really happy with it! :smiley:

By the way, i have setup custom line height (3) and my font size is set at 16. But, my cursor is always following line height size, how can I make it to follow my font size?

If you still confused what I mean, please check this pic http://pbrd.co/1rvpyDo

Thanks… :+1:


#2

Try this in ~/.atom/styles.less:

.editor:not(.mini) .cursor {
	height: 16px !important;
	margin-top: 16px;
}

#3

whoaa… thats work. But it looks weird when I zoom my font using Command-+. What should I do? Is it possible to make it dynamically resize when I resize my font size?


#4

You could try to use em for font sizing, that way it should scale correctly.


#5

I’m not sure. The problem is the font size is set programmatically and isn’t available to styles :frowning:

Edit: Using ems seems to work pretty well.

.editor:not(.mini) .cursor {
	height: 1em !important;
	margin-top: 1em;
}

#6

Man, this works. Thanks :wink: