Sublime Forum

get_regions does not work

#1

This should work, but it doesn’t.


	v = sublime.active_window().active_view()
	r = [sublime.Region(s.a, s.b) for s in v.sel()]

	if r:
		print('see regions has something: '+str(r))

	v.add_regions('r', r) 

	r = v.get_regions('r')
	if r:
		print('see regions has something: '+str(r))

	v.run_command('undo')

	r = v.get_regions('r') # this should work, but it doesn't
	if not r:
		print('bug!')

0 Likes

#2
0 Likes