A nice $window().line feature could return the line number which the line marker occupies, $null if it isn't active.