Пример #1
0
    def get_syntax(self):
        """
		Returns current editor's syntax mode
		@return: str
		"""
        zones = {"css, css *": "css", "xsl, xsl *": "xsl", "xml, xml *": "xml", "haml, haml *": "haml"}
        rng = tea.get_first_range(self._context)
        return tea.select_from_zones(self._context, rng, "html", **zones)
Пример #2
0
    def get_selection_range(self):
        """
		Returns character indexes of selected text
		@return: list of start and end indexes
		@example
		start, end = zen_editor.get_selection_range();
		print('%s, %s' % (start, end))
		"""
        rng = tea.get_first_range(self._context)
        return rng.location, rng.location + rng.length
Пример #3
0
    def get_selection_range(self):
        """
		Returns character indexes of selected text
		@return: list of start and end indexes
		@example
		start, end = zen_editor.get_selection_range();
		print('%s, %s' % (start, end))
		"""
        rng = tea.get_first_range(self._context)
        return rng.location, rng.location + rng.length
Пример #4
0
    def get_syntax(self):
        """
		Returns current editor's syntax mode
		@return: str
		"""
        zones = {
            'css, css *': 'css',
            'xsl, xsl *': 'xsl',
            'xml, xml *': 'xml',
            'haml, haml *': 'haml'
        }
        rng = tea.get_first_range(self._context)
        return tea.select_from_zones(self._context, rng, 'html', **zones)
Пример #5
0
	def get_syntax(self):
		"""
		Returns current editor's syntax mode
		@return: str
		"""
		zones = {
			'css, css *': 'css',
			'xsl, xsl *': 'xsl',
			'xml, xml *': 'xml',
			'haml, haml *': 'haml'
		}
		rng = tea.get_first_range(self._context)
		return tea.select_from_zones(self._context, rng, 'html', **zones)