Lines Matching refs:cc
81 self.cc = codecontext.CodeContext(self.editor)
104 if self.cc.context:
105 self.cc.context.destroy()
107 self.cc.__del__()
108 del self.cc.context, self.cc
113 cc = self.cc
115 eq(cc.editwin, ed)
116 eq(cc.text, ed.text)
117 eq(cc.text['font'], ed.text['font'])
118 self.assertIsNone(cc.context)
119 eq(cc.info, [(0, -1, '', False)])
120 eq(cc.topvisible, 1)
121 self.assertIsNone(self.cc.t1)
124 self.cc.__del__()
127 timer = self.cc.t1 = self.text.after(10000, lambda: None)
128 self.cc.__del__()
135 self.assertEqual(self.cc.context_depth, 15)
139 cc = self.cc
140 toggle = cc.toggle_code_context_event
143 if cc.context:
148 self.assertIsNotNone(cc.context)
149 eq(cc.context['font'], self.text['font'])
150 eq(cc.context['fg'], self.highlight_cfg['foreground'])
151 eq(cc.context['bg'], self.highlight_cfg['background'])
152 eq(cc.context.get('1.0', 'end-1c'), '')
153 eq(cc.editwin.label, 'Hide Code Context')
154 eq(self.root.tk.call('after', 'info', self.cc.t1)[1], 'timer')
158 self.assertIsNone(cc.context)
159 eq(cc.editwin.label, 'Show Code Context')
160 self.assertIsNone(self.cc.t1)
163 line11_context = '\n'.join(x[2] for x in cc.get_context(11)[0])
164 cc.text.yview(11)
166 eq(cc.context.get('1.0', 'end-1c'), line11_context)
171 eq(cc.context.get('1.0', 'end-1c'), line11_context)
175 gc = self.cc.get_context
223 cc = self.cc
225 if not cc.context:
226 cc.toggle_code_context_event()
229 self.assertIsNone(cc.update_code_context())
230 eq(cc.info, [(0, -1, '', False)])
231 eq(cc.topvisible, 1)
234 cc.text.yview(1)
235 cc.update_code_context()
236 eq(cc.info, [(0, -1, '', False)])
237 eq(cc.topvisible, 2)
238 eq(cc.context.get('1.0', 'end-1c'), '')
241 cc.text.yview(2)
242 cc.update_code_context()
243 eq(cc.info, [(0, -1, '', False), (2, 0, 'class C1:', 'class')])
244 eq(cc.topvisible, 3)
245 eq(cc.context.get('1.0', 'end-1c'), 'class C1:')
248 cc.text.yview(3)
249 cc.update_code_context()
250 eq(cc.info, [(0, -1, '', False), (2, 0, 'class C1:', 'class')])
251 eq(cc.topvisible, 4)
252 eq(cc.context.get('1.0', 'end-1c'), 'class C1:')
255 cc.text.yview(4)
256 cc.update_code_context()
257 eq(cc.info, [(0, -1, '', False),
260 eq(cc.topvisible, 5)
261 eq(cc.context.get('1.0', 'end-1c'), 'class C1:\n'
265 cc.text.yview(11)
266 cc.update_code_context()
267 eq(cc.info, [(0, -1, '', False),
272 eq(cc.topvisible, 12)
273 eq(cc.context.get('1.0', 'end-1c'), 'class C1:\n'
279 cc.update_code_context()
280 cc.context_depth = 1
281 eq(cc.info, [(0, -1, '', False),
286 eq(cc.topvisible, 12)
287 eq(cc.context.get('1.0', 'end-1c'), 'class C1:\n'
293 cc.text.yview(5)
294 cc.update_code_context()
295 eq(cc.info, [(0, -1, '', False),
298 eq(cc.topvisible, 6)
300 eq(cc.context.get('1.0', 'end-1c'), ' def __init__(self, a, b):')
304 cc = self.cc
305 jump = cc.jumptoline
307 if not cc.context:
308 cc.toggle_code_context_event()
311 cc.text.yview('2.0')
312 cc.update_code_context()
313 eq(cc.topvisible, 2)
314 cc.context.mark_set('insert', '1.5')
316 eq(cc.topvisible, 1)
319 cc.text.yview('12.0')
320 cc.update_code_context()
321 eq(cc.topvisible, 12)
322 cc.context.mark_set('insert', '3.0')
324 eq(cc.topvisible, 8)
327 cc.context_depth = 2
328 cc.text.yview('12.0')
329 cc.update_code_context()
330 eq(cc.topvisible, 12)
331 cc.context.mark_set('insert', '1.0')
333 eq(cc.topvisible, 8)
336 cc.text.yview('5.0')
337 cc.update_code_context()
338 cc.context.tag_add('sel', '1.0', '2.0')
339 cc.context.mark_set('insert', '1.0')
341 eq(cc.topvisible, 5)
346 if self.cc.context:
347 self.cc.toggle_code_context_event()
348 self.cc.timer_event()
352 self.cc.toggle_code_context_event()
353 self.cc.timer_event()
358 cc = self.cc
360 orig_font = cc.text['font']
365 if cc.context is not None:
366 cc.toggle_code_context_event()
370 cc.update_font()
373 cc.toggle_code_context_event()
374 eq(cc.context['font'], test_font)
378 cc.update_font()
379 eq(cc.context['font'], orig_font)
383 cc = self.cc
389 eq(cc.context['background'], colors['background'])
390 eq(cc.context['foreground'], colors['foreground'])
393 if cc.context:
394 cc.toggle_code_context_event()
398 cc.update_highlight_colors()
401 cc.toggle_code_context_event()
405 cc.update_highlight_colors()
410 cc.update_highlight_colors()