I used to have a working test with
Currently, when my package’s code runs after being instantiated from the spec test the
getFirstVisibleScreenRow() returns 0, as does the corresponding
I have a file loaded with atom.workspace.open ‘test_text.MD’.
All of the above used to work just fine.
When I enter the debugger in the spec test, I notice that for example:
textEditor.getScreenLineCount() is 34 or
textEditor.getLastScreenRow() is 33.
My package’s code of course needs to continue to be focused on the range of rows between the 2 visible points.
code I have is:
firstVisibleRow = editor.getFirstVisibleScreenRow() lastVisibleRow = editor.getLastVisibleScreenRow()
and then later:
for lineNumber in [firstVisibleRow...lastVisibleRow]
Aside: This time I’m seeing this can probably be:
for lineNumber in editor.getVisibleRowRange()
So, I think I need a way to set the viewable width/height, basically setting some kind of “screen port” or something. This was something that in the past I left to mystery as it always seemed to work the way I wanted it to, although I always thought that you should have to set it in case you needed to test that kind of thing.