コード例 #1
0
ファイル: diff.py プロジェクト: ymmas/livestyle-sublime
def _start_diff(buf_id):
	view = eutils.view_for_buffer_id(buf_id)
	if view is None:
		return

	state = _diff_state[buf_id]
	prev_content = state['content']
	content = eutils.content(view)
	syntax = get_syntax(view)

	state['required'] = False

	client = ws.find_client({'supports': 'css'})

	if client:
		logger.debug('Use connected "%s" client for diff' % client.name())
		lock_state(state)
		ws.send({
			'action': 'diff',
			'data': {
				'file': buf_id,
				'syntax': syntax,
				'source1': prev_content,
				'source2': content
			}
		}, client)
	else:
		logger.error('No suitable client for diff')
コード例 #2
0
ファイル: diff.py プロジェクト: ymmas/livestyle-sublime
def _start_diff(buf_id):
    view = eutils.view_for_buffer_id(buf_id)
    if view is None:
        return

    state = _diff_state[buf_id]
    prev_content = state['content']
    content = eutils.content(view)
    syntax = get_syntax(view)

    state['required'] = False

    client = ws.find_client({'supports': 'css'})

    if client:
        logger.debug('Use connected "%s" client for diff' % client.name())
        lock_state(state)
        ws.send(
            {
                'action': 'diff',
                'data': {
                    'file': buf_id,
                    'syntax': syntax,
                    'source1': prev_content,
                    'source2': content
                }
            }, client)
    else:
        logger.error('No suitable client for diff')
コード例 #3
0
ファイル: diff.py プロジェクト: ymmas/livestyle-sublime
def _start_patch(buf_id, patch):
	view = eutils.view_for_buffer_id(buf_id)
	if view is None:
		logger.debug('No view to patch')
		return

	content = eutils.content(view)
	syntax = get_syntax(view)
	state = _patch_state[buf_id]


	client = ws.find_client({'supports': 'css'})
	logger.debug('Client: %s' % client)

	if client:
		logger.debug('Use connected "%s" client for patching' % client.name())
		lock_state(state)
		ws.send({
			'action': 'patch',
			'data': {
				'file': buf_id,
				'syntax': syntax,
				'patches': patch,
				'source': content
			}
		}, client)
	else:
		logger.error('No suitable client for patching')
コード例 #4
0
ファイル: diff.py プロジェクト: ymmas/livestyle-sublime
def _start_patch(buf_id, patch):
    view = eutils.view_for_buffer_id(buf_id)
    if view is None:
        logger.debug('No view to patch')
        return

    content = eutils.content(view)
    syntax = get_syntax(view)
    state = _patch_state[buf_id]

    client = ws.find_client({'supports': 'css'})
    logger.debug('Client: %s' % client)

    if client:
        logger.debug('Use connected "%s" client for patching' % client.name())
        lock_state(state)
        ws.send(
            {
                'action': 'patch',
                'data': {
                    'file': buf_id,
                    'syntax': syntax,
                    'patches': patch,
                    'source': content
                }
            }, client)
    else:
        logger.error('No suitable client for patching')