Sublime Forum

Dimensions of View

#1

I can figure out the height of a view by using View.rowcol on the begin and end of View.visible_region, but this only works if the buffer is longer than the view and the view isn’t scrolled past the end of the buffer. Additionally, it’s very hard to figure out how wide the view is. Could there be a function that returns the width and height of the view? Even better, if it could also return the row-offset and column-offset, that’d be ideal. The row-offset is easy to figure out, but the column-offset is hard to figure out in the same way that the width of the view is.
Thanks!

0 Likes

#2

It would also be awesome if I could pass a column-offset into View.show. This would allow me to do things like scroll the buffer a little bit further right past the end of a short line as long as there are longer lines in the file—right now it’s difficult to use View.show to scroll the view to places that it’s easy to get to by using the scrollbars.

0 Likes