Sublime 2 compatible
This commit is contained in:
parent
d27edae3c0
commit
3a3d95994d
|
@ -7,6 +7,11 @@ import re
|
||||||
from xml.etree import ElementTree
|
from xml.etree import ElementTree
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
|
||||||
|
try:
|
||||||
|
basestring
|
||||||
|
except NameError:
|
||||||
|
basestring = str
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# python 3 / Sublime Text 3
|
# python 3 / Sublime Text 3
|
||||||
from . import simplejson as json
|
from . import simplejson as json
|
||||||
|
@ -412,7 +417,7 @@ class PrettyJsonGotoSymbolCommand(PrettyJsonBaseCommand, sublime_plugin.TextComm
|
||||||
self.generate_items(json_data[key], new_key_name)
|
self.generate_items(json_data[key], new_key_name)
|
||||||
elif isinstance(json_data, list):
|
elif isinstance(json_data, list):
|
||||||
for index, item in enumerate(json_data):
|
for index, item in enumerate(json_data):
|
||||||
if isinstance(item, str):
|
if isinstance(item, basestring):
|
||||||
self.items.append('%s' % root_key + '.' + item)
|
self.items.append('%s' % root_key + '.' + item)
|
||||||
self.goto_items.append('"%s"' % item)
|
self.goto_items.append('"%s"' % item)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue