コード例 #1
0
 def run_zencoding_action(action):
     file_types = ('HTML', 'PHP', 'XML', 'CSS')
     cur_file_type = geany.document.get_current().file_type.name
     if cur_file_type in file_types:
         doc = geany.document.get_current()
         zen_editor = ZenEditor(doc)
         zencoding.run_action(action, editor=zen_editor)
コード例 #2
0
    def run(self, view, contexter, kw):
        matches = []

        for i, selection in enumerate(contexter):
            args = kw.copy()

            if self.last_matches and not i >= len(self.last_matches):
                last_match.update(self.last_matches[i])

            zencoding.run_action(args.pop('action'), editor, **args)
            matches.append(last_match.copy())

        self.last_matches = matches
コード例 #3
0
    def run(self, view, contexter, kw):
        matches = []

        for i, selection in enumerate(contexter):
            args = kw.copy()

            if self.last_matches and not i >= len(self.last_matches):
                last_match.update(self.last_matches[i])

            zencoding.run_action(args.pop('action'), editor, **args)
            matches.append(last_match.copy())

        self.last_matches = matches
コード例 #4
0
	def wrap(self, context, abbr):
		# Set up the config variables
		if abbr:
			editor = ZenEditor(context)
			return zencoding.run_action('wrap_with_abbreviation', editor, abbr)
		else:
			return False
コード例 #5
0
 def wrap(self, context, abbr):
     # Set up the config variables
     if abbr:
         editor = ZenEditor(context)
         return zencoding.run_action('wrap_with_abbreviation', editor, abbr)
     else:
         return False
コード例 #6
0
ファイル: runner.py プロジェクト: Viral1994/zen-coding.ruble
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import zencoding
import sys
from zen_editor import ZenEditor
import reflect

editor = ZenEditor()
try:
	args = sys.argv[2:]
except:
	args = []

try:	
	zencoding.run_action(sys.argv[1], editor, *args)
except zencoding.utils.ZenError:
	print(sys.exc_info()[1])
コード例 #7
0
def update_image_size():
	zencoding.run_action('update_image_size', _npp_editor)
コード例 #8
0
def increment_number(step):
	zencoding.run_action('increment_number', _npp_editor, step)
コード例 #9
0
def evaluate_math_expression():
	zencoding.run_action('evaluate_math_expression', _npp_editor)
コード例 #10
0
def reflect_css_value():
	zencoding.run_action('reflect_css_value', _npp_editor)
コード例 #11
0
def remove_tag():
	zencoding.run_action('remove_tag', _npp_editor)
コード例 #12
0
def next_edit_point():
	zencoding.run_action('next_edit_point', _npp_editor)
コード例 #13
0
def toggle_comment():
	zencoding.run_action('toggle_comment', _npp_editor)
コード例 #14
0
def match_pair_outward():
	zencoding.run_action('match_pair_outward', _npp_editor)
コード例 #15
0
def go_to_matching_pair():
	zencoding.run_action('go_to_matching_pair', _npp_editor)
コード例 #16
0
def select_previous_item():
	zencoding.run_action('select_previous_item', _npp_editor)
コード例 #17
0
def select_next_item():
	zencoding.run_action('select_next_item', _npp_editor)
コード例 #18
0
def prev_edit_point():
	zencoding.run_action('prev_edit_point', _npp_editor)
コード例 #19
0
def expand_abbreviation(isTab):
	global _profile
	result = zencoding.run_action('expand_abbreviation', _npp_editor, None, _profile)
	if isTab and result == False:
		Npp.editor.tab()
コード例 #20
0
def split_join_tag():
	zencoding.run_action('split_join_tag', _npp_editor)
コード例 #21
0
def merge_lines():
	zencoding.run_action('merge_lines', _npp_editor)
コード例 #22
0
def wrap_with_abbreviation():
	global _profile
	abbr = Npp.notepad.prompt("Wrap with abbreviation:", "Zen Coding - Python")
	if abbr is not None:
		zencoding.run_action('wrap_with_abbreviation', _npp_editor, abbr, None, _profile)