Number of Lines Selected #215
Replies: 1 comment
-
There are at least two ways I can think of:
buffer:line_from_position(buffer.selection_end) - buffer:line_from_position(buffer.selection_start)
select(2, buffer:get_sel_text():gsub('\n', ''))
If you always want a minimum of 1, then also call `math.max(1, result)` with your result.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
goober99
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to get the number of lines selected with Lua?
Beta Was this translation helpful? Give feedback.
All reactions