Previously it would use the last char position, which resulted in incorrect values when the next char had a different size than the current one.
(cherry picked from commit f066c88e186a02b9912d7f102b541f514ae1aa35)
* added a stupid __tostring to every object
* moved every __tostring to just after the :extend() call
---------
Co-authored-by: Adam <adamdharrison@gmail.com>
(cherry picked from commit 880e7f1fa1521cdf176f44627a27c901e187058e)
* Stop drawing text past the `DocView` edge in `DocView:draw_line_text`
* Don't add draw commands if they fall outside the latest clip
The check was previously done with the window rect, so this will reduce
a bit more the number of commands sent.
* Avoid updating IME input rect if it hasn't changed
* Update the IME input rect even when the composition didn't change
* Apply IME input blocking workaround to non-Linux only
* docview: support gutter click selection, fixes#1116
* Added missing call to parent on_mouse_pressed
Also fixed call to selections when `shift` is pressed.
* change to arrow instead of hand
Co-authored-by: Adam <adamdharrison@gmail.com>
* Make `Scrollbar` accept a table for its options
* Add `force_status`, `{expanded,shrinked}_size` options to `Scrollbar`
* Add `Scrollbar:set_forced_status`
* Add `config.force_scrollbar_status` to force `DocView` scrollbars status
* Fixed rendering computations for y offset.
* Force monospacing if every ascii character has the same integer advance.
* Added in explanatory comment.
* Fixed issues.
* Made lines less long.
This is needed for example when a selection has both `line1` and `col1`
at 1, and the left arrow is pressed: `line2` and `col2` change, while
`line1` and `col1` don't, but we still want to scroll.
Fixing the Node's clipping rectangle make the clipping in DocView:draw()
partially redundant. This latter is now no longer needed to clip
on the right when drawing the document's lines but it still serves to
the purpose of clipping on the left, before the gutter region.
This function gets called at every `core.step`, so we should avoid
having to recalculate the scrollable size every time, as it could get
very expensive on long lines.