Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Show Lines Number
-
I'm on a 5, I'd like at least an option for line numbers. I do most stuff on my iPad, but iPhone productivity is decreased because of this. When it throws a syntax error on line 65, but doesn't highlight and jump to it, I can't find line 65 without significant trouble.
-
I don't have an iphone to test this on, but you could try this:
# coding: utf-8 from objc_util import * app=UIApplication.sharedApplication() rootVC = app.keyWindow().rootViewController() tabVC = rootVC.detailViewController() tvc=tabVC.selectedTabViewController() ed=tvc.editorView() tv=ed.textView() tv.showLineNumbers=not tv.showLineNumbers() #not sure how to force a redraw. changing frame size works oldframe=tv.frame() newframe=oldframe newframe.size.width-=1 tv.frame=newframe import time time.sleep(0.1) tv.frame=oldframe
maybe use in an action script, and it should toggle line numbers in the current tab. Not sure if the view heirarchy is the same on iphone, so maybe this won't work.
-
This script is fantastic on my iPhone 6s. It even shows line wraps with a dot. This really needs to be added in a new update by default.
-
@JonB is there any way to change the color? Black really clashes with my theme. Also, can I make it flush with the edge of the editor?
-
updated... https://gist.github.com/bbd5ef7e2e4010a631bd
background color works. I didn't bother messing with the gutterSeparatorView, but you should be able to adjust that color to match the theme ( i forget where the theme is actually stored)note you cam change gutterWidth and the number font changes, so you can go as small as your eyes will work. 20 seems reasonable, the default seemed to be 35 on my ipad. I suppose I should put this inside a function so it does not mash globals, and you can toggle on/off as desired.
-
@JonB thanks. There's still black stripes around it, but they're not too obtrusive. This is also a relatively impermanent solution because it goes away after switching scripts
-
I think a short description might be useful:
- Touch the script name (togglelinenumbers.py)
- Go to Actions (tool symbol)
- Edit => + => Done => Done => Cancel
- Open your script
- Repeat step 1, 2 and run togglelinenumbers.py
-
@brumm I understand. I just wish they were always on.
-
-
@antibody Note that the better way to this is now as mentioned here