last line detection

I am in need of detecting when the cursor is on the last line (to disable some CSS) - I can do this using the onSelectionChange handler, but this seems highly inefficient, on every cursor move, etc I’m getting the total lines, then checking if the cursor is on that line.

is there a more efficient way of doing this?

No, it’s fine. Calling .lastLine() is very cheap.

Thank you!