[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
Sun Oct 31 05:11:57 UTC 2021


> Would you have any objection to moving the -1 from get_line_and_offset_from_text to editor_goto_line so that line_no is always non-negative as previously expected?

Since the function that decodes the text value is `static` its only available for use inside callbacks.c so making it return the number the user input for both absolute and offset cases is more consistent and less accident prone than returning the number for offset and the number minus one for absolute, so this is fine.

`editor_go_to_line()` isn't in the plugin API, so its only usable inside Geany, so making it one based is also fine, but probably best to add a comment above it to say that so we don't go through this again.



-- 
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-955638491
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211030/d2dceec4/attachment.htm>


More information about the Github-comments mailing list