[Github-comments] [geany/geany] When "go to line" is out of bounds, go to beginning or end of document (PR #2973)

elextr notifications at xxxxx
Sat Oct 30 04:47:00 UTC 2021


Since it is intended that the line number is always positive (and it is in both cases where `editor_goto_line()` is called) and the sign is communicated in `offset` it is a programming error if `line_no < 0` so it should use one of the glib checks that log a warning, eg `g_return_val_if_fail()`.  Have a look at the usage elsewhere in Geany since Glib doesn't bother to document it any more.

Also its really only needed to check for out of range after the offset calculation, checking before and setting to max will still give an out of range result (for any current line except 0) so no need to check before.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2973#issuecomment-955147309
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211029/ceb5036a/attachment.htm>


More information about the Github-comments mailing list