// find the index of the line we need to show at the top of the window such
// that the last (fully or partially) visible line is the given one
// find the index of the line we need to show at the top of the window such
// that the last (fully or partially) visible line is the given one