def start_plugin(): ws.start(int(eutils.get_setting('port'))) logger.setLevel(logging.DEBUG if eutils.get_setting('debug', False) else logging.INFO) # collect all view's file paths for view in eutils.all_views(): _view_file_names[view.id()] = eutils.file_name(view)
def start_plugin(): ws.start(int(eutils.get_setting('port'))) logger.setLevel( logging.DEBUG if eutils.get_setting('debug', False) else logging.INFO) # collect all view's file paths for view in eutils.all_views(): _view_file_names[view.id()] = eutils.file_name(view)
def send_patches(buf_id=None, p=None): if not buf_id or not p: return p = eutils.parse_json(p) view = eutils.view_for_buffer_id(buf_id) if p and view is not None: ws.send({"action": "update", "data": {"editorFile": eutils.file_name(view), "patch": p}})
def on_post_save(self, view): k = view.id() new_name = eutils.file_name(view) if k in _view_file_names and _view_file_names[k] != new_name: send_message({ 'action': 'renameFile', 'data': { 'oldname': _view_file_names[k], 'newname': new_name } }) _view_file_names[k] = new_name
def apply_patch_on_view(view, patch): "Waita until view is loaded and applies patch on it" if view.is_loading(): return sublime.set_timeout(lambda: apply_patch_on_view(view, patch), 100) # make sure it's a CSS file if not eutils.is_css_view(view, True): logger.debug('File %s is not CSS, aborting' % eutils.file_name(view)) return focus_view(view) lsutils.diff.patch(view.buffer_id(), patch, apply_patched_source)
def start_plugin(): global settings settings = sublime.load_settings('LiveStyle.sublime-settings') start_server(int(settings.get('port'))) logger.setLevel(logging.DEBUG if settings.get('debug', False) else logging.INFO) settings.add_on_change('settings', handle_settings_change) lsutils.diff.import_pyv8() # collect all view's file paths for view in eutils.all_views(): _view_file_names[view.id()] = eutils.file_name(view)
def start_plugin(): global settings settings = sublime.load_settings('LiveStyle.sublime-settings') start_server(int(settings.get('port'))) logger.setLevel( logging.DEBUG if settings.get('debug', False) else logging.INFO) settings.add_on_change('settings', handle_settings_change) lsutils.diff.import_pyv8() # collect all view's file paths for view in eutils.all_views(): _view_file_names[view.id()] = eutils.file_name(view)
def send_patches(buf_id=None, p=None): if not buf_id or not p: return p = parse_json(p) view = eutils.view_for_buffer_id(buf_id) if p and view is not None: send_message({ 'action': 'update', 'data': { 'editorFile': eutils.file_name(view), 'patch': p } })
def send_patches(buf_id=None, p=None): if not buf_id or not p: return p = eutils.parse_json(p) view = eutils.view_for_buffer_id(buf_id) if p and view is not None: ws.send({ 'action': 'update', 'data': { 'editorFile': eutils.file_name(view), 'patch': p } })
def send_patches(buf_id=None, p=None): if not buf_id or not p: return logger.debug(p) p = json.loads(p) view = eutils.view_for_buffer_id(buf_id) if p and view is not None: send_message({ 'action': 'update', 'data': { 'editorFile': eutils.file_name(view), 'patch': p } })
def on_load(self, view): _view_file_names[view.id()] = eutils.file_name(view) if eutils.is_css_view(view): update_files()
def on_post_save(self, view): k = view.id() new_name = eutils.file_name(view) if k in _view_file_names and _view_file_names[k] != new_name: ws.send({"action": "renameFile", "data": {"oldname": _view_file_names[k], "newname": new_name}}) _view_file_names[k] = new_name