Skip to main content

Atom Text Editor and Cursor Displacement

1 min read

I have been having experiencing an odd behavior with Atom in that, sometimes, my visibile cursor within an editor buffer is not actually lined up with what I am editing. Thus, when I hit backspace, for example, the wrong character is deleted. It's a real confusing pain in the ass.

It turns out this was being caused by a problem in Atom when using certain fonts. I was using Hasklig which has some cool ligatures for things like === and =>. The Atom folks already know about the problem and have an issue created for it however, it isn't very clear when it will be fixed. So, for the time being, if you notice you are having this problem change out your font to something like consolas.

To make matters worse one of the settings I had in my user stylesheet to optimize for legibility exacerbated the problem. Thus, I needed to get rid of that style from the body element:

body {
  -webkit-font-smoothing: antialiased;
  //text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
}