MCPcopy Index your code
hub / github.com/chasingboy/Xtools / select_urls

Function select_urls

utils.py:222–235  ·  view source on GitHub ↗
(view, path=False)

Source from the content-addressed store, hash-verified

220
221
222def select_urls(view, path=False):
223 pattern = r'https?://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]'
224 regions = view.find_all(pattern, sublime.IGNORECASE)
225
226 array = []
227 for region in regions:
228 text = view.substr(region)
229 if path == False:
230 text = delete_url_path(text)
231 if text not in array:
232 array.append(text)
233
234 text = '\n'.join(array)
235 return text
236
237
238def exec_command(cmd):

Callers 2

runMethod · 0.85
runMethod · 0.85

Calls 1

delete_url_pathFunction · 0.85

Tested by

no test coverage detected