<p></p>
<blockquote>
<p dir="auto">I'd argue this isn't consistent at all because the last "line" isn't a line at all (according to POSIX). Trying to move the cursor past the last line with text shouldn't go anywhere.</p>
</blockquote>
<p dir="auto">It is <em>self-consistent</em>, i.e., consistent with the rest of Geany's behavior, not consistent with POSIX.<br>
Specifically, Geany will display an empty line at the end of a file if the file is newline-terminated, and not do it if it's not, so the user can tell the two cases apart.<br>
This is not the case for Gedit, for example, which will happily open newline-terminated files and non-newline-terminated files, treating the latter exactly as the former, so you can never tell if the file was actually newline-terminated.  (A more "correct" behavior for POSIX compliance would be to refuse to open those files, but that would just be an unnecessary obstacle.)</p>
<p dir="auto">This is all a matter of whether you consider a text file as a sequence of newline-<em>terminated</em> lines or newline-<em>separated</em> lines.  POSIX requires the former, but not everything is POSIX.  For example, C has this requirement, C++11 doesn't, Git and diff don't but display an ugly note in the output, and some weird formats (arguably not 100% able to be considered as "text files") may stop working if you add a newline at the end, but are otherwise perfectly viewable and editable with Geany.<br>
<em>(Also, notice that it's called <strong>new</strong>line, so it kind of hints that a new line comes after it :) although this is probably a poor argument.)</em></p>
<p dir="auto">A possible compromise solution would be to display the last line with a <code>+</code>, <code>\</code>, or <code>end</code> as the line number, indicating that it's "not a real line"; that way it's technically not "line <em>n</em>", but "weird thing at the end", or "start typing here to add a new line to the file"; that way you don't have to hide it, but don't have to count it as a line either:</p>
<blockquote>
<p dir="auto"><code>1</code> int main(void) {<br>
<code>2</code>     return 0;<br>
<code>3</code> }<br>
<code>+</code><br>
<code> </code></p>
</blockquote>
<p dir="auto">(the tricky part is that the status bar would have to report "line: 4 / 3" or "line: end / 3" if you wanted that indicator to be POSIX-compliant, but I guess that can be done)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2727#issuecomment-972759222">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ7GBWDKQILUDWNMQWLUMTMFDANCNFSM4V6CSWTQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ3MDDDV3UZ6DYEEFM3UMTMFDA5CNFSM4V6CSWT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHH5SBNQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2727#issuecomment-972759222",
"url": "https://github.com/geany/geany/issues/2727#issuecomment-972759222",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>