Subversion Repositories Kolibri OS

Rev

Rev 267 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
259 mikedld 1
 
2
func draw_editor ;////////////////////////////////////////////////////////////
3
;-----------------------------------------------------------------------------
4
5
 
6
	mov	bx,word[cur_tab.Editor.Bounds.Right]
7
	sub	bx,word[cur_tab.Editor.Bounds.Left]
8
	inc	ebx
9
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
10
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
11
	sub	cx,word[cur_tab.Editor.Bounds.Top]
12
	inc	ecx
13
	mov	edx,[cl_3d_inset]
14
	call	draw_framerect
15
@^
16
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
17
	mov	bx,word[cur_tab.Editor.Bounds.Right]
18
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
19
	mov	cx,word[cur_tab.Editor.Bounds.Top]
20
	mcall	38,,,[cl_3d_inset]
21
	mov	ecx,[cur_tab.Editor.Bounds.Bottom-2]
22
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
23
	mcall
24
	mov	bx,word[cur_tab.Editor.Bounds.Left]
25
	mov	cx,word[cur_tab.Editor.Bounds.Top]
26
	mcall
27
	mov	ebx,[cur_tab.Editor.Bounds.Right-2]
28
	mov	bx,word[cur_tab.Editor.Bounds.Right]
29
	mov	cx,word[cur_tab.Editor.Bounds.Top]
30
	mcall
31
^@
32
	mov	[cur_tab.Editor.Gutter.Visible],0
33
	test	[options],OPTS_LINENUMS
34
	jnz	@f
35
	xor	eax,eax ;! mov eax,2+LCHGW
36
	jmp	.lp1
37
    @@: inc	[cur_tab.Editor.Gutter.Visible]
38
	mov	edi,p_info+100
39
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
40
	mov	ecx,10
41
	call	uint2str
42
	lea	eax,[edi-p_info-100]
43
	cmp	eax,3
44
	jae	@f
45
	mov	eax,3
46
    @@: imul	eax,6
47
	add	eax,8
48
  .lp1: mov	[cur_tab.Editor.Gutter.Width],eax ;! [left_ofs],eax
49
	mov	[left_ofs],eax
50
51
 
52
	call	draw_editor_vscroll
53
	call	draw_editor_hscroll
54
	call	draw_editor_text
55
	call	draw_editor_caret
56
57
 
58
endf
59
60
 
61
func draw_editor_gutter ;/////////////////////////////////////////////////////
62
;-----------------------------------------------------------------------------
63
	cmp	[cur_tab.Editor.Gutter.Visible],0
64
	je	.exit
65
66
 
67
68
 
69
	mov	bx,word[cur_tab.Editor.Gutter.Width]
70
	add	ebx,0x00010000
71
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
72
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
73
	sub	cx,word[cur_tab.Editor.Bounds.Top]
74
	add	cx,-SCRLW
75
	add	ecx,0x00010000
76
	dec	cx
77
	mcall	13,,,[cl_3d_normal]
78
79
 
80
	push	bx
81
	shl	ebx,16
82
	pop	bx
83
	add	ecx,[cur_tab.Editor.Bounds.Top]
84
	mcall	38,,,[cl_3d_inset]
85
86
 
87
	mov	bx,word[cur_tab.Editor.Bounds.Top]
88
	add	bx,3
89
	mov	edi,[sc.work_text]
90
	mov	ecx,[cur_tab.Editor.TopLeft.Y]
91
	inc	ecx
92
	mov	edx,p_info+100
93
    @@: pushad
94
	push	eax edx edi
95
	mov	eax,ecx
96
	mov	ecx,10
97
	mov	edi,edx
98
	call	uint2str
99
	mov	esi,edi
100
	pop	edi edx eax
101
	sub	esi,edx
102
	imul	eax,esi,6*65536
103
	sub	ebx,eax
104
	mcall	4,,edi
105
	popad
106
	add	ebx,LINEH
107
	inc	ecx
108
	cmp	ecx,[cur_tab.Editor.Lines]
109
	jg	@f
110
	mov	esi,ecx
111
	sub	esi,[cur_tab.Editor.TopLeft.Y]
112
	cmp	esi,[lines.scr]
113
	jbe	@b
114
    @@: add	esp,4*8*2
115
116
 
117
	ret
118
endf
119
120
 
121
func draw_editor_vscroll ;////////////////////////////////////////////////////
122
;-----------------------------------------------------------------------------
123
;!!!!!!!!!!!!!!!!!!
124
	mov	ebx,[cur_tab.Editor.Bounds.Right]
125
	shl	ebx,16
126
	add	ebx,(-SCRLW)*65536+SCRLW
127
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
128
	mov	cx,SCRLW
129
	mcall	8,,,'UP' or 0x40000000
130
	pushad
131
	sar	ebx,16
132
	sar	ecx,16
133
	push	ebx ecx SCRLW SCRLW
134
	call	draw_3d_panel
135
	popad
136
	mov	eax,8
137
;!!!!!!!!!!!!!!!!!!
138
139
 
140
	push	0x18
141
	shr	ecx,16
142
	mov	bx,cx
143
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
144
	mcall	4,,[sc.work_text],esp,1
145
	add	esp,4
146
	popad
147
148
 
149
	mov	ecx,[cur_tab.Editor.Bounds.Bottom]
150
	shl	ecx,16
151
	add	ecx,(-SCRLW*2)*65536+SCRLW
152
	mcall	,,,'DN' or 0x40000000
153
	pushad
154
	sar	ebx,16
155
	sar	ecx,16
156
	push	ebx ecx SCRLW SCRLW
157
	call	draw_3d_panel
158
	popad
159
	mov	eax,8
160
;!!!!!!!!!!!!!!!!!!
161
162
 
163
	push	0x19
164
	shr	ecx,16
165
	mov	bx,cx
166
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
167
	mcall	4,,[sc.work_text],esp,1
168
	add	esp,4
169
	popad
170
171
 
172
	mov	eax,[cur_tab.Editor.Lines]
173
	mov	ebx,[lines.scr]
174
	mov	ecx,[cur_tab.Editor.TopLeft.Y]
175
	mov	edx,[cur_tab.Editor.Bounds.Bottom]
176
	sub	edx,[cur_tab.Editor.Bounds.Top]
177
	add	edx,-SCRLW*3+1
178
	call	get_scroll_vars
179
	mov	[cur_tab.Editor.VScroll.Top],eax
180
	mov	[cur_tab.Editor.VScroll.Size],ebx
181
	pop	ebx
182
183
 
184
	add	ecx,[cur_tab.Editor.Bounds.Top]
185
	add	ecx,SCRLW+1
186
187
 
188
	pushad
189
	sar	ebx,16
190
	push	ebx ecx SCRLW [cur_tab.Editor.VScroll.Size]
191
	dec	dword[esp]
192
	call	draw_3d_panel
193
	popad
194
	mov	eax,13
195
;!!!!!!!!!!!!!!!!!!
196
	add	ebx,1*65536-1
197
198
 
199
	mov	cx,word[cur_tab.Editor.VScroll.Top]
200
	add	ecx,(SCRLW+1)*65536
201
	mov	edx,[sc.work]
202
	or	cx,cx
203
	jle	@f
204
	mcall	13
205
    @@:
206
	mov	ecx,[cur_tab.Editor.Bounds.Top]
207
	add	ecx,[cur_tab.Editor.VScroll.Top]
208
	add	ecx,[cur_tab.Editor.VScroll.Size]
209
	add	ecx,SCRLW+1
210
	mov	di,cx
211
	shl	ecx,16
212
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
213
	sub	cx,di
214
	sub	cx,SCRLW*2;+1
215
	jle	@f
216
	mcall
217
    @@:
218
	rol	ebx,16
219
	dec	bx
220
	push	bx
221
	rol	ebx,16
222
	pop	bx
223
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
224
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
225
	add	ecx,(SCRLW)*65536-SCRLW*2-1
226
	mcall	38,,,[cl_3d_inset]
227
228
 
229
endf
230
231
 
232
func draw_editor_hscroll ;////////////////////////////////////////////////////
233
;-----------------------------------------------------------------------------
234
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
235
	mov	bx,SCRLW
236
	mov	ecx,[cur_tab.Editor.Bounds.Bottom]
237
	shl	ecx,16
238
	add	ecx,(-SCRLW)*65536+SCRLW
239
	mcall	8,,,'LT' or 0x40000000
240
	pushad
241
	sar	ebx,16
242
	sar	ecx,16
243
	push	ebx ecx SCRLW SCRLW
244
	call	draw_3d_panel
245
	popad
246
;!!!!!!!!!!!!!!!!!!
247
248
 
249
	push	0x1B
250
	shr	ecx,16
251
	mov	bx,cx
252
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
253
	mcall	4,,[sc.work_text],esp,1
254
	add	esp,4
255
	popad
256
257
 
258
	mov	ebx,[cur_tab.Editor.Bounds.Right]
259
	shl	ebx,16
260
	add	ebx,(-SCRLW*2)*65536+SCRLW
261
	mcall	8,,,'RT' or 0x40000000
262
	pushad
263
	sar	ebx,16
264
	sar	ecx,16
265
	push	ebx ecx SCRLW SCRLW
266
	call	draw_3d_panel
267
	popad
268
;!!!!!!!!!!!!!!!!!!
269
270
 
271
	push	0x1A
272
	shr	ecx,16
273
	mov	bx,cx
274
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
275
	mcall	4,,[sc.work_text],esp,1
276
	add	esp,4
277
	popad
278
279
 
280
	mov	eax,[cur_tab.Editor.Columns]
281
	mov	ebx,[columns.scr]
282
	mov	ecx,[cur_tab.Editor.TopLeft.X]
283
	mov	edx,[cur_tab.Editor.Bounds.Right]
284
	add	edx,-(SCRLW*3)
285
	call	get_scroll_vars
286
	mov	[cur_tab.Editor.HScroll.Top],eax
287
	mov	[cur_tab.Editor.HScroll.Size],ebx
288
	pop	ecx
289
290
 
291
	add	ebx,[cur_tab.Editor.Bounds.Left]
292
	add	ebx,SCRLW+1
293
	shl	ebx,16
294
	mov	bx,word[cur_tab.Editor.HScroll.Size]
295
296
 
297
	pushad
298
	sar	ecx,16
299
	rol	ebx,16
300
	movsx	eax,bx
301
	sar	ebx,16
302
	dec	ebx
303
	push	eax ecx ebx SCRLW
304
	call	draw_3d_panel
305
	popad
306
;!!!!!!!!!!!!!!!!!!
307
	add	ecx,1*65536-1
308
309
 
310
	mov	bx,word[cur_tab.Editor.Bounds.Left]
311
	mov	bx,word[cur_tab.Editor.HScroll.Top]
312
	add	ebx,(1+SCRLW)*65536
313
	mcall	13,,,[sc.work]
314
	mov	ebx,[cur_tab.Editor.Bounds.Left]
315
	add	ebx,1+SCRLW
316
	add	ebx,[cur_tab.Editor.HScroll.Top]
317
	add	ebx,[cur_tab.Editor.HScroll.Size]
318
	mov	di,bx
319
	shl	ebx,16
320
	mov	bx,word[cur_tab.Editor.Bounds.Right]
321
	sub	bx,di
322
	sub	bx,SCRLW*2
323
	jle	@f
324
	mcall
325
    @@:
326
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
327
	mov	bx,word[cur_tab.Editor.Bounds.Right]
328
	add	ebx,(SCRLW)*65536-SCRLW*2-1
329
	rol	ecx,16
330
	dec	cx
331
	push	cx
332
	rol	ecx,16
333
	pop	cx
334
	mcall	38,,,[cl_3d_inset]
335
336
 
337
endf
338
339
 
340
func draw_editor_text ;///////////////////////////////////////////////////////
341
;-----------------------------------------------------------------------------
342
	mov	eax,[cur_tab.Editor.Bounds.Bottom]
343
	sub	eax,[cur_tab.Editor.Bounds.Top]
344
	cmp	eax,LINEH
345
	jge	@f
346
	ret
347
    @@:
348
	call	init_sel_vars
349
	call	check_bottom_right
350
351
 
352
353
 
354
	add	eax,[cur_tab.Editor.Gutter.Width]
355
	add	eax,LCHGW+3
356
	mov	[left_ofs],eax
357
	mov	eax,[cur_tab.Editor.Bounds.Top]
358
	add	eax,3
359
	mov	[top_ofs],eax
360
361
 
362
	add	ebx,[left_ofs-2]
363
364
 
365
	push	ecx
366
	call	get_line_offset
367
368
 
369
	add	esp,4
370
	mov	ecx,[lines.scr]
371
	or	ecx,ecx
372
	jle	.exit
373
	add	esp,-4
374
375
 
376
	mov	eax,[lines.scr]
377
	sub	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
378
	mov	[draw_blines],eax
379
380
 
381
382
 
383
384
 
385
	shl	ecx,16
386
	mov	cl,LINEH
387
	mov	ebx,[cur_tab.Editor.Bounds.Right]
388
	;sub     ebx,[cur_tab.Editor.Bounds.Left]
389
	add	ebx,-SCRLW
390
	add	ebx,[left_ofs-2]
391
	sub	ebx,[left_ofs]
392
	add	ebx,-2*65536+2
393
394
 
395
	mov	[in_sel],0
396
	mov	edx,[color_tbl+4*5]
397
	mov	eax,[esp+4*2]
398
	cmp	eax,[sel.begin.y]
399
	jl	.lp6
400
	je	.lp1
401
	cmp	eax,[sel.end.y]
402
	jg	.lp6
403
	je	.lp3
404
	jmp	.lp6.2
405
  .lp1: mov	eax,[sel.begin.y]
406
	cmp	eax,[sel.end.y]
407
	je	.lp5
408
  .lp2: mov	eax,[sel.begin.x]
409
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
410
	jle	.lp6.2
411
	cmp	eax,[columns.scr]
412
	jge	.lp6
413
	imul	eax,6
414
	pushad
415
	sub	bx,ax
416
	rol	ebx,16
417
	mov	bx,ax
418
	add	ebx,[left_ofs]
419
	add	ebx,-2
420
	rol	ebx,16
421
	mov	edx,[color_tbl+4*7]
422
	mcall	13
423
	popad
424
	mov	bx,ax
425
	mov	[in_sel],2
426
	jmp	.lp6
427
  .lp3: mov	eax,[sel.begin.y]
428
	cmp	eax,[sel.end.y]
429
	je	.lp5
430
  .lp4: mov	eax,[sel.end.x]
431
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
432
	jle	.lp6
433
	cmp	eax,[columns.scr]
434
	jg	.lp6.2
435
	imul	eax,6
436
	pushad
437
	sub	bx,ax
438
	rol	ebx,16
439
	add	eax,[left_ofs];OLEFT-1
440
	add	eax,-2
441
	mov	bx,ax
442
	rol	ebx,16
443
	mcall	13
444
	popad
445
	inc	eax
446
	mov	edx,[color_tbl+4*7]
447
	mov	bx,ax
448
	mov	[in_sel],3
449
	jmp	.lp6
450
  .lp5: mov	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
451
	cmp	eax,[sel.begin.x]
452
	jge	.lp4
453
	add	eax,[columns.scr]
454
	cmp	eax,[sel.end.x]
455
	jl	.lp2
456
	mov	eax,[sel.begin.x]
457
	cmp	eax,[sel.end.x]
458
	je	.lp6
459
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
460
	imul	eax,6
461
	pushad
462
	mov	ebx,[sel.end.x]
463
	sub	ebx,[sel.begin.x]
464
	imul	ebx,6
465
	sal	ebx,16
466
	dec	eax
467
	add	eax,[left_ofs]
468
	mov	bx,ax
469
	rol	ebx,16
470
	mov	edx,[color_tbl+4*7]
471
	mcall	13
472
	movzx	eax,bx
473
	sar	ebx,16
474
	add	eax,ebx
475
	mov	ebx,eax
476
	sal	ebx,16
477
	sub	ax,[esp+4*4]
478
	neg	ax
479
	add	ax,word[left_ofs]
480
	add	ax,-2
481
	mov	bx,ax
482
	mov	edx,[color_tbl+4*5]
483
	mcall	13
484
	popad
485
	mov	bx,ax
486
	mov	[in_sel],4
487
	jmp	.lp6
488
489
 
490
	mov	edx,[color_tbl+4*7]
491
	inc	[in_sel]
492
  .lp6:
493
	mcall	13
494
495
 
496
497
 
498
	mov	edx,[color_tbl+4*5]
499
	test	eax,0x00010000
500
	jz	@f
501
	mov	edx,[color_tbl+4*8]
502
	test	eax,0x00020000
503
	jz	@f
504
	mov	edx,[color_tbl+4*9]
505
    @@: mov	ebx,[left_ofs]
506
	add	ebx,-LCHGW-2;-4
507
	shl	ebx,16
508
	mov	bx,LCHGW
509
	mcall	13
510
	popad
511
512
 
513
	and	eax,0x0000FFFF
514
	mov	[cur_line_len],eax
515
516
 
517
	ja	.next_block
518
	add	esp,4*2
519
	jmp	.exit ; .draw_cursor
520
521
 
522
523
 
524
	call	get_next_part
525
	pop	ebx
526
527
 
528
	mov	ecx,eax
529
530
 
531
	mov	eax,ebx
532
	sub	ebx,[cur_tab.Editor.TopLeft.X] ;! ebx,[left_col]
533
	cmp	ebx,[columns.scr]
534
	jge	.skip_t
535
	add	ebx,esi
536
	jle	.skip_t
537
	mov	ebx,[esp+8+4*2] ;// 4*2=esi+ebx
538
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
539
	jge	.qqq
540
	sub	edx,eax
541
	add	esi,eax
542
;       mov     eax,OLEFT*65536
543
	xor	eax,eax
544
	jmp	.qqq2
545
  .qqq:
546
;       inc     eax
547
	imul	eax,6*65536
548
  .qqq2:
549
	and	ebx,0x0000FFFF
550
	add	eax,[left_ofs-2];OLEFT*65536
551
	add	ebx,eax
552
553
 
554
	add	eax,[esp+4] ; esi
555
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
556
	sub	eax,[columns.scr]
557
	jle	.qweqwe
558
	sub	esi,eax
559
  .qweqwe:
560
561
 
562
	cmp	al,0
563
	je	.draw_t
564
	dec	al
565
	jz	.ya4
566
  .nt1: dec	al
567
	jnz	.nt2
568
	mov	eax,[esp]
569
	cmp	eax,[sel.begin.x]
570
	jge	.ya4
571
	add	eax,[esp+4]
572
	cmp	eax,[sel.begin.x]
573
	jl	.draw_t
574
;---[ selection crosses block from the right ]-(-
575
  .ya1: mov	eax,esi
576
	mov	esi,[sel.begin.x]
577
	sub	esi,[esp]
578
	pushad
579
	mov	ecx,[cur_tab.Editor.TopLeft.X] ;! ecx,[left_col]
580
	sub	ecx,[esp+4*8]
581
	jle	@f
582
	sub	esi,ecx
583
	sub	[esp+4],ecx
584
    @@: sub	eax,esi
585
	add	edx,esi
586
	imul	esi,6
587
	rol	ebx,16
588
	add	bx,si
589
	rol	ebx,16
590
	mov	esi,eax
591
	mov	ecx,[color_tbl+4*6]
592
	mcall	4
593
	popad
594
	jmp	.draw_t
595
;----------------------------------------------)-
596
  .nt2: dec	al
597
	jnz	.nt3
598
	mov	eax,[esp]
599
	cmp	eax,[sel.end.x]
600
	jge	.draw_t
601
	add	eax,[esp+4]
602
	cmp	eax,[sel.end.x]
603
	jl	.ya4
604
;---[ selection crosses block from the left ]--(-
605
  .ya2: mov	eax,[sel.end.x]
606
	sub	eax,[esp]
607
	push	ebx
608
	mov	ebx,[esp+4]
609
	sub	ebx,[cur_tab.Editor.TopLeft.X] ;! ebx,[left_col]
610
	jge	.ya2.1
611
	add	eax,ebx
612
  .ya2.1:
613
	pop	ebx
614
	pushad
615
	mov	esi,eax
616
	mov	ecx,[color_tbl+4*6]
617
	mcall	4
618
	popad
619
	sub	esi,eax
620
	add	edx,eax
621
	imul	eax,6*65536
622
	add	ebx,eax
623
	jmp	.draw_t
624
;----------------------------------------------)-
625
  .nt3: mov	eax,[esp]
626
	cmp	eax,[sel.end.x]
627
	jge	.draw_t
628
	cmp	eax,[sel.begin.x]
629
	jge	@f
630
	add	eax,[esp+4]
631
	cmp	eax,[sel.begin.x]
632
	jl	.draw_t
633
	cmp	eax,[sel.end.x]
634
	jl	.ya1
635
;---[ selection inside block ]-----------------(-
636
	mov	eax,esi
637
	mov	esi,[sel.begin.x]
638
	sub	esi,[esp]
639
	push	eax
640
	mov	eax,[esp+4]
641
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
642
	jge	.nt3.1
643
	add	esi,eax
644
  .nt3.1:
645
	pop	eax
646
	sub	eax,esi
647
	pushad
648
	add	edx,esi
649
	imul	esi,6*65536
650
	add	ebx,esi
651
	mov	esi,[sel.end.x]
652
	sub	esi,[sel.begin.x]
653
	mov	ecx,[color_tbl+4*6]
654
	sub	eax,esi
655
	push	eax
656
	mcall	4
657
	add	edx,esi
658
	imul	esi,6*65536
659
	add	ebx,esi
660
	pop	esi
661
	mov	ecx,[esp+4*6]
662
	mcall	4
663
	popad
664
	jmp	.draw_t
665
;----------------------------------------------)-
666
    @@: add	eax,esi
667
	dec	eax
668
	cmp	eax,[sel.end.x]
669
	jge	.ya2
670
;---[ block inside selection ]-----------------(-
671
  .ya4: mov	ecx,[color_tbl+4*6]
672
;----------------------------------------------)-
673
674
 
675
	mcall	4;[esp+8]
676
  .skip_t:
677
	pop	eax eax ; ebx esi
678
	imul	eax,6
679
	add	[esp+4*2+2],ax
680
	pop	ecx esi
681
	cmp	ecx,[cur_line_len];LINE_WIDTH
682
	jl	.next_block
683
684
 
685
	and	ebx,0x0000FFFF
686
	add	ebx,[left_ofs-2]
687
	add	ebx,LINEH
688
	add	esi,[cur_line_len];LINE_WIDTH
689
	inc	dword[esp]
690
	dec	ecx
691
	jg	.next_line
692
693
 
694
695
 
696
	jl	@f
697
	mov	ecx,[esp-8]
698
	shl	ecx,16
699
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
700
	sub	cx,[esp-8]
701
	add	cx,-SCRLW
702
	mov	eax,[cur_tab.Editor.Bounds.Left]
703
	add	eax,[cur_tab.Editor.Gutter.Width]
704
	inc	eax
705
	mov	ebx,eax
706
	shl	ebx,16
707
	mov	bx,word[cur_tab.Editor.Bounds.Right]
708
	sub	bx,ax
709
	add	ebx,-SCRLW
710
	mcall	13,,,[color_tbl+4*5]
711
    @@:
712
713
 
714
	add	esp,4
715
	ret
716
endf
717
718
 
719
func draw_editor_caret ;//////////////////////////////////////////////////////
720
;-----------------------------------------------------------------------------
721
	cmp	[bot_mode],0
722
	jne	@f
723
	mov	ebx,[cur_tab.Editor.Caret.X]
724
	sub	ebx,[cur_tab.Editor.TopLeft.X]
725
	js	@f
726
	cmp	ebx,[columns.scr]
727
	ja	@f
728
	imul	ebx,6
729
	add	ebx,[left_ofs]
730
	dec	ebx
731
	push	bx
732
	shl	ebx,16
733
	pop	bx
734
	mov	eax,[cur_tab.Editor.Caret.Y]
735
	sub	eax,[cur_tab.Editor.TopLeft.Y]
736
	js	@f
737
	cmp	eax,[lines.scr]
738
	jge	@f
739
	imul	eax,LINEH
740
	add	eax,[top_ofs]
741
	mov	esi,eax
742
	shl	esi,16
743
	add	eax,LINEH-2
744
	mov	si,ax
745
	mov	ecx,2
746
	cmp	[ins_mode],0
747
	jne	.lp8
748
	add	cl,4
749
  .lp8: push	ecx
750
	mcall	38,,esi,0x01000000
751
	add	ebx,0x00010001
752
	pop	ecx
753
	loop	.lp8
754
    @@:
755
	ret
756
endf
757