http://ndudfield.com/zencoding/old/search-in-area.gif
Blocks are good for rudimentary scoped
var renaming too
http://ndudfield.com/zencoding/old/search-in-area.gif
Blocks are good for rudimentary scoped
var renaming too
[quote=âcastles_made_of_sandâ]
Blocks are good for rudimentary scoped
var renaming too
How did you find boundaries of current blocks? Also with ast or some other method?[/quote]
def find_block_starts(view, block_tokens):
regex = re.compile(block_tokens if block_tokens else BLOCKERS)
return [r for r in view.find_by_selector('keyword,storage') if
view.find(r'\S', view.line(r).begin()).begin() == r.begin() and
regex.match(view.substr(r)) ]
Basically by finding block starting tokens, bisecting the closest to each selection and then using some indentation comparing routines, to find extents of a block. Used a bit of scope awareness etc.
Things like that worked better in ST 1 & 2 when the api was faster and you could do a lot of pt
by pt
stuff.
Great!
Installation instructions:
Clone this repo into your Preferences -> Browse Packages
directory.
github.com/wuub/SublimeEyeball
make sure that at least one pythons have eyeball installed (pip install eyeball should work).
Pick the one you code for, or both if you use py2 and py3. Eyeball relies on ast module and it can only parse the same version of python as itself, so py27 might not be able to understand all of python3 and vice versa.
github.com/wuub/SublimeEyeball/ ⌠20(Windows.sublime-settings
Ctrl+Shift+C to select block of code, repeat to cycle up.
Notes:
I just saw this !! great!
but⌠itâs not working yet!
I get this error in the console:
SublimeEyeball c:\Python32\pythonw.exe No JSON object could be decoded
(I have python 3.2 installed, not python 3.3, so i just changed the line in your file)
c:\python32\python.exe -m eyeball
should wait for input.Edit: I did not check for py3.2 compatibility before, but it doesnât seem to be a problem here travis-ci.org/wuub/eyeball
hmm that previous post i made was completely wrong, I m still looking into itâŚ
eeer ok found the problem. It wasnât syntactically correct
Works perfect now !! many thanks !!
It is very weird though, I have the following code:
def __init__(self):
super(PublishedItem,self).__init__()
# self.tree = ''
self.XML_publications_root = ''
# self.AuthorAddresses = "Î/Î"
self.Abstract = "unbounded"
self.ArticleNumber = "unbounded"
self.AuthorAddresses = ] # this contains the orig addresses coming in
self.Address_AuthorsDict = dict()
self.Authors = ]
self.AuthorFullName = ]
and it doesnât work because of the fifth line. Why is that? itâs commented anyway!
[quote=âsfrankyâ]It is very weird though, I have the following code:
and it doesnât work because of the fifth line. Why is that? itâs commented anyway![/quote]
No problems on my end whatsoever. Works like a charm with this example.
EDIT
In SublimeEyeball/eyeball_select.py try to print(out) & print(err) in line 19. Maybe itâll tell us something.
hmm strangeâŚvery strange. Upon seeing the messages below, I overwrote (in insert mode) all the characters of the line, character by character. And now it works fine⌠how is this possible?
b''
b'Traceback (most recent call last):
File "c:\\Python32\\lib\\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\\Python32\\lib\\runpy.py", line 73, in _run_code
exec(code, run_globals)
File "c:\\Python32\\lib\\site-packages\\eyeball\\__main__.py", line 33, in <module>
main()
File "c:\\Python32\\lib\\site-packages\\eyeball\\__main__.py", line 27, in main
code = sys.stdin.read()
File "c:\\Python32\\lib\\encodings\\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: \'charmap\' codec can\'t decode byte 0x9d in position 11251: character maps to <undefined>
'
SublimeEyeball c:\Python32\pythonw.exe No JSON object could be decoded
Yeah, encodings and stdio handling on windows.
One of my favourite things to debug, right after killing process trees with cmd.exe in themâŚ
Iâll try to take make it more reliable soon, it would be great if you could assemble a small problematic file and create a github issue ?
I will, as soon as you tell me how to reproduce it !! I wiped the bad line and replaced it with a working one, and now I canât make it not workâŚ
btw, is there a way for the screen to follow the cursor?
if i ctrl+shift+c while inside a function that extends outside the screen, i canât see the cursor anymore. I would expect to find this setting in ST itself, but it doesnât seem to exist⌠is it intended in your plugin?
[quote=âsfrankyâ]btw, is there a way for the screen to follow the cursor?
if i ctrl+shift+c while inside a function that extends outside the screen, i canât see the cursor anymore. I would expect to find this setting in ST itself, but it doesnât seem to exist⌠is it intended in your plugin?[/quote]
Could you report any issues and questions in the github repo?
Here: github.com/wuub/SublimeEyeball/issues
if itâs something related to Sublime integration (like the problem above)
Or here: github.com/wuub/eyeball/issues
if you think itâs a problem with the library itself (wrong selection, tracebacks and so on). If you arenât sure which one is correct, just pick one at random
I tend to not check those threads regularly, and when I do I later forget about the reported issues.