Exemple #1
0
	def __init__(self, *args, **kwargs):
		if not hasattr(vim, 'strwidth'):
			# Hope nobody want to change this at runtime
			if vim.eval('&ambiwidth') == 'double':
				kwargs = dict(**kwargs)
				kwargs['ambigious'] = 2
		super(VimRenderer, self).__init__(*args, **kwargs)
		self.hl_groups = {}
		self.prev_highlight = None
		self.strwidth_error_name = register_strwidth_error(self.strwidth)
		self.encoding = vim.eval('&encoding')
Exemple #2
0
	def __init__(self, *args, **kwargs):
		if not hasattr(vim, 'strwidth'):
			# Hope nobody want to change this at runtime
			if vim.eval('&ambiwidth') == 'double':
				kwargs = dict(**kwargs)
				kwargs['ambigious'] = 2
		super(VimRenderer, self).__init__(*args, **kwargs)
		self.hl_groups = {}
		self.prev_highlight = None
		self.strwidth_error_name = register_strwidth_error(self.strwidth)
		self.encoding = get_vim_encoding()
Exemple #3
0
	def test_register_strwidth_error(self):
		ename = plu.register_strwidth_error(lambda s: 3)
		self.assertStringsIdentical(b'???', 'A'.encode('latin1', ename))
		self.assertStringsIdentical(b'abc', 'abc'.encode('latin1', ename))
Exemple #4
0
 def test_register_strwidth_error(self):
     ename = plu.register_strwidth_error(lambda s: 3)
     self.assertStringsIdentical(b'???', 'A'.encode('latin1', ename))
     self.assertStringsIdentical(b'abc', 'abc'.encode('latin1', ename))