Page 1 of 1

Script editor horizontal scrolling issue

Posted: 03 Nov 2016 16:37
by heilong
I've noticed it's not easy to horizontally scroll the editor.
I'm trying to scroll a large script with some long lines, as long as I'm careful and don't move my finger vertically, it scrolls,
as soon as I move my finger vertically somewhat, and the editor scrolls vertically by some amount, I can't horizontal scrolling anymore.
I think you try to prevent horizontal scrolling when the user intends to only scroll vertically, a common feature of browsers etc.
So if the user starts to scroll, if the initial scrolling direction is vertical, only vertical scrolling would be possible until the finger is released.
But apparently you keep checking for vertical scrolling, and disable horizontal later as well.
I think when the user first scrolls the editor, the initial direction should be checked if it's closer to vertical than horizontal. If more vertical - scroll only
vertically. If more horizontal - free scroll (or just horizontal scroll? don't remember what's the common behavior in other apps).

Re: Script editor horizontal scrolling issue

Posted: 04 Nov 2016 10:08
by bogdyro
Hi. It's not very easy to work with long scripts, that's for sure. However I've installed a keyboard from the playstore (Hacker's keyboard) that has arrows like the physical keyboards so you can easily move e between the lines. It's not updated in a few years so it doesn't look pretty but it's helpful indeed.

Re: Script editor horizontal scrolling issue

Posted: 04 Nov 2016 10:32
by heilong
bogdyro wrote:Hi. It's not very easy to work with long scripts, that's for sure. However I've installed a keyboard from the playstore (Hacker's keyboard) that has arrows like the physical keyboards so you can easily move e between the lines. It's not updated in a few years so it doesn't look pretty but it's helpful indeed.
Thanks - I'm using Hacker's keyboard too. Actually the author keeps working on it somewhat, he just didn't release any updates on Play Store or F-Droid, but you can get the latest pre-release apk on GitHub. It's still ugly as hell. Hope he would make an theme that looks like a modern AOSP/Google keyboard. Or maybe one of us should make a new theme, maybe it's not that hard.

Still, for just viewing (studying) a long script I want to hide the keyboard and just scroll the editor around.

I believe what I mentioned in the first post is a scrolling bug that should be fixed.

P.S. Martin, since the topic of "not very easy to work with long scripts", I'd like to mention another thing. There's already a "wrap long lines" option. I thought on a small phone's screen it would be the best way to deal with long lines. However the wrapping is pretty basic and makes the code much less readable. Please consider improving the wrapping: show wrap symbols, indent wrapped lines one level more than the first line. Here are a couple of screenshots from Notepad2-mod:
20161104_132727_C__project_apps_FXCalc_src_com_razorscript_math_expression_lexers_StringLexer.as.png
20161104_132727_C__project_apps_FXCalc_src_com_razorscript_math_expression_lexers_StringLexer.as.png (37.8 KiB) Viewed 14823 times
20161104_132648_C__project_apps_FXCalc_src_com_razorscript_math_expression_lexers_StringLexer.as.png
20161104_132648_C__project_apps_FXCalc_src_com_razorscript_math_expression_lexers_StringLexer.as.png (35.84 KiB) Viewed 14823 times

Re: Script editor horizontal scrolling issue

Posted: 05 Nov 2016 13:05
by Martin
Hi,

I agree that scrolling in the script editor can be a pain. I had high hopes that Google would fix the text component at some point to improve scrolling a bit but unfortunately it didn't get any better. I add it to my todo list to investigate if I can improve it in the future.

Some keyboards (Google keyboard) also support to drag the finger along the space bar to move the cursor which also helps.

Regards,
Martin

Re: Script editor horizontal scrolling issue

Posted: 05 Nov 2016 13:10
by heilong
So the way scrolling works is a built-in feature of the text component, not something your code can control? Does the text component offer any options to customize the scrolling behavior? Maybe it's possible to intercept the touch events on the text component and handle them without relying on the built-in handling?

I'm indeed using google keyboard's drag along the space bar, or hacker keyboard's arrows. For that to be helpful, the cursor should be first position to the correct (longest) line. But which line is the longest is not obvious when viewing a large script.

Re: Script editor horizontal scrolling issue

Posted: 05 Nov 2016 13:25
by Martin
I hope that the text component itself provides some options but I have to check and make some tests first to see if this actually helps or just makes everything worse.
I could handle the touch interaction myself but I prefer to investigate the built-in options first. Maybe a few buttons to control the cursor could also be helpful since only few keyboards provide such buttons on their own.

Re: Script editor horizontal scrolling issue

Posted: 05 Nov 2016 13:30
by heilong
Totally understand, better check the available options first than write a bunch of your own code.