Support narrowing

Calculate the line number according to the file.