rubyFeedback created an issue (geany/geany#4540)
Hey there geany devs,
This is probably a tiny issue.
I just tested it. I compiled geany from source yesterday, so it is very recent.
If you use the "go to line" functionality and input, say, 23000, and the file
has 22000 lines, then it will jump to the last line. So far so good.
If you put a very high number here, though, the behaviour of geany is
to jump to the very first line. This surprised me, because I believe jumping
to the last line, is more useful here - after all the user did input a very
large number. That means the user wanted to jump to the last line, most
likely. It could have been a typo, but I think in most cases the user did
want to jump to the last file. My brain actually is hard-wired to this
behaviour due to the bluefish editor, so I'd love to see the same behaviour
here, as it makes sense.
Now ... I was actually testing at which number geany behaves this way.
After all, if the number is larger than the current amount of lines in the
editor, then geany will jump the cursor to the last line. So it kind of works.
But it does not work one a certain threshold is crossed suddenly. So I
was curious at which threshold geany behaves this way.
I was not able to determine the exact number, but this number here works,
geany jumps to the bottom, which is the correct behaviour (in my opinion):
2147455000
But this number is too high and geany will place the cursor at the very first
line, which is IMO incorrect or, at the least, not as useful:
2147555000
Perhaps this has to do with some C data structure or some integer or float here?
I am not good when it comes to C, but I just tested it on the file with 22.000
lines.
The behaviour is consistent here:
if I input 2147455000, I reach the end of the file; if I input 2147555000, then
I am at the top of the file again.
Personally I think it would make more sense to assume that if the input number
is too high, to simply assume it will be "the very end of the file", so that
number
could just be set to the max-lines (or max-lines + 1) of the currently edited
file.
That should then work. I know a little bit of GTK, so this evaluation must take
place in the input-widget (gtk entry) that handles the go-to-file functionality.
Probably an additional check has to be used. Anyway, I could be wrong, so this
is just me trying to speculate about this behaviour. Either way I believe the
current behaviour is a bit confusing, since it seems a bit arbitrary that the
number threshold is like it is (hence I think it may be a tiny bug); my
preferred
fix would be to assume that, no matter how high the number is, to always
opt for the last line in such an event when the user did input too high a
number,
which is the current behaviour anyway, except when the number input is "too
high" (which is strange to me; if this were the desired behaviour, then why
would
e. g. a number that is somewhat lower but still very high, mean to jump to the
last line? That seems an arbitrary threshold to me, hence why I think this is
a small bug. But probably nobody noticed it, my brain is just so hardwired
to quickly type numbers rather than try to remember how many lines a given
feil has).
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/4540
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/issues/[email protected]>