Thanks for putting this code out there. I can't believe how hard it is to add line numbers to an NSTextView. You'd think Apple would either put out example code or make a standard view that can be used.

I used your code for a project I was working on and it has turned out great. One thing that I found out though is that your latest release (0.4.1) will not work on 64-bit machines. The problem is that you are using floats instead of CGFloat. This is mostly not an issue since it'll get cast to the correct value, but since you are then using NSInvocation which sets arguments via addresses to memory, it gets a bit messy. The margin was not showing up when compiled as 64-bit. Once I changed the floats to CGFloats everything started working.