libide/sourceview: Fix calculation of multiline range
It fixes multiline range calculation in ide_source_view_get_visual_position_range function which is used by position label
- Add +1 to range length, because we are dealing with closed interval
- Move insert or selection iterator backwards depending on direction of selection, so it will be located inside selection and we can determine across how many lines does selection span.
More about bugs:
-
Make a selection which spans across multiple lines. See range in position label: its off by 1.
-
Make a selection which goes from up to down and has '\n' in the end: range is correct here but if we fix first bug it going to be greater by 1 than expected.
Same thing with selection from down to up with '\n' at the start.