Reputation: 96
I'm trying to get the line number of the bottom of the current screen. I've tried:
winsaveview()['topline'] + winheight(0) - 1
But this doesn't take into account folds.
How do I get the bottom line of the current screen in vimscript that takes into account folds?
Upvotes: 1
Views: 257
Reputation: 45147
You can use line()
with w$
to get last line visible in current window
:echo line('w$')
For more help see :h line()
Upvotes: 5