Subversion Repositories Kolibri OS

Rev

Rev 259 | Rev 280 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 259 Rev 267
Line 44... Line 44...
44
	mov	al,2
44
	mov	al,2
45
	call	[bot_dlg_handler]
45
	call	[bot_dlg_handler]
46
	jmp	still
46
	jmp	still
47
    @@:
47
    @@:
Line 48... Line 48...
48
 
48
 
49
	mov	esi,accel_table
49
	mov	esi,accel_table_main
50
  .acc: cmp	eax,[esi]
50
  .acc: cmp	eax,[esi]
51
	jne	@f
51
	jne	@f
52
	test	[options],OPTS_SECURESEL
52
	test	[options],OPTS_SECURESEL
53
	jz	.lp1
53
	jz	.lp1
54
	m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
54
	m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
55
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y] ;! [sel.y],[pos.y]
55
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
56
  .lp1: mov	[s_status],0
56
  .lp1: mov	[s_status],0
57
	call	dword[esi+4]
57
	call	dword[esi+4]
58
	jmp	still
58
	jmp	still
59
    @@: add	esi,8
59
    @@: add	esi,8
Line 72... Line 72...
72
	movzx	eax,[eax+key1]
72
	movzx	eax,[eax+key1]
73
	push	eax
73
	push	eax
Line 74... Line 74...
74
 
74
 
75
	test	[options],OPTS_SECURESEL
75
	test	[options],OPTS_SECURESEL
76
	jz	.lp2
76
	jz	.lp2
77
	m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
77
	m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
78
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y] ;! [sel.y],[pos.y]
78
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
79
	jmp	.put
79
	jmp	.put
Line 80... Line 80...
80
  .lp2: call	delete_selection
80
  .lp2: call	delete_selection
81
 
81
 
82
	test	[options],OPTS_AUTOBRACES
82
	test	[options],OPTS_AUTOBRACES
83
	jz	.put
83
	jz	.put
84
	cmp	al,'['
84
	cmp	al,'['
85
	jne	@f
85
	jne	@f
86
	mov	al,']'
86
	mov	al,']'
87
	call	.lp3
87
	call	.lp3
88
	dec	[cur_tab.Editor.Caret.X] ;! [pos.x]
88
	dec	[cur_editor.Caret.X] ;! [pos.x]
89
	jmp	.put
89
	jmp	.put
90
    @@: cmp	al,'('
90
    @@: cmp	al,'('
91
	jne	@f
91
	jne	@f
92
	mov	al,')'
92
	mov	al,')'
93
	call	.lp3
93
	call	.lp3
94
	dec	[cur_tab.Editor.Caret.X] ;! [pos.x]
94
	dec	[cur_editor.Caret.X] ;! [pos.x]
95
	jmp	.put
95
	jmp	.put
96
    @@: cmp	al,'{'
96
    @@: cmp	al,'{'
97
	jne	.put
97
	jne	.put
98
	mov	al,'}'
98
	mov	al,'}'
Line 99... Line 99...
99
	call	.lp3
99
	call	.lp3
100
	dec	[cur_tab.Editor.Caret.X] ;! [pos.x]
100
	dec	[cur_editor.Caret.X] ;! [pos.x]
101
 
101
 
102
  .put: pop	eax
102
  .put: pop	eax
103
	push	still
103
	push	still
104
	inc	[cur_tab.Editor.SelStart.X] ;! [sel.x]
104
	inc	[cur_editor.SelStart.X] ;! [sel.x]
105
  .lp3: push	[cur_tab.Editor.Caret.X] eax ;! [pos.x] eax
105
  .lp3: push	[cur_editor.Caret.X] eax ;! [pos.x] eax
Line 106... Line 106...
106
	inc	dword[esp+4]
106
	inc	dword[esp+4]
107
	mov	eax,1
107
	mov	eax,1
108
	jmp	key.tab.direct
108
	jmp	key.tab.direct
109
 
109
 
110
;-----------------------------------------------------------------------------
110
;-----------------------------------------------------------------------------
111
func key.ctrl_a ;///// SELECT ALL DOCUMENT ///////////////////////////////////
111
func key.ctrl_a ;///// SELECT ALL DOCUMENT ///////////////////////////////////
112
;-----------------------------------------------------------------------------
112
;-----------------------------------------------------------------------------
113
	xor	eax,eax
113
	xor	eax,eax
114
	mov	[cur_tab.Editor.SelStart.X],eax ;! [sel.x],eax
114
	mov	[cur_editor.SelStart.X],eax ;! [sel.x],eax
115
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
115
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
116
	mov	ecx,[cur_tab.Editor.Lines] ;! ecx,[lines]
116
	mov	ecx,[cur_editor.Lines.Count] ;! ecx,[lines]
117
	dec	ecx
117
	dec	ecx
118
	mov	[cur_tab.Editor.Caret.Y],ecx ;! [pos.y],ecx
118
	mov	[cur_editor.Caret.Y],ecx ;! [pos.y],ecx
119
	call	get_line_offset
119
	call	get_line_offset
120
	call	get_real_length
120
	call	get_real_length
Line 121... Line 121...
121
	mov	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
121
	mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
Line 145... Line 145...
145
	rep	movsb
145
	rep	movsb
Line 146... Line 146...
146
 
146
 
147
    @@: mov	al,[tb_opensave.length]
147
    @@: mov	al,[tb_opensave.length]
148
	mov	[tb_opensave.pos.x],al
148
	mov	[tb_opensave.pos.x],al
149
	mov	[tb_opensave.sel.x],0
149
	mov	[tb_opensave.sel.x],0
150
	mov	[tb_casesen],1
150
	mov	[tb_casesen],0;1
151
	call	drawwindow
151
	call	drawwindow
152
	ret
152
	ret
Line 153... Line 153...
153
endf
153
endf
154
 
154
 
155
;-----------------------------------------------------------------------------
155
;-----------------------------------------------------------------------------
156
func key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////////////////////
156
func key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////////////////////
157
;-----------------------------------------------------------------------------
157
;-----------------------------------------------------------------------------
158
	cmp	[cur_tab.Editor.Modified],0 ;! [modified],0
158
	cmp	[cur_editor.Modified],0 ;! [modified],0
159
	je	.exit
159
	je	.exit
160
	cmp	[f_info.length],0
160
	cmp	[f_info.length],0
161
	je	key.shift_ctrl_s
161
	je	key.shift_ctrl_s
Line 168... Line 168...
168
	mov	[bot_dlg_mode2],1
168
	mov	[bot_dlg_mode2],1
169
	jmp	key.ctrl_o.direct
169
	jmp	key.ctrl_o.direct
170
endf
170
endf
Line 171... Line 171...
171
 
171
 
172
;-----------------------------------------------------------------------------
172
;-----------------------------------------------------------------------------
173
func key.ctrl_n ;///// ENTER SAVE FILENAME ///////////////////////////////////
173
func key.ctrl_n ;///// CREATE NEW FILE (TAB) /////////////////////////////////
174
;-----------------------------------------------------------------------------
174
;-----------------------------------------------------------------------------
175
	call	create_tab
175
	call	create_tab
176
	ret
176
	ret
Line 246... Line 246...
246
	call	clear_selection
246
	call	clear_selection
Line 247... Line 247...
247
 
247
 
248
;-----------------------------------------------------------------------------
248
;-----------------------------------------------------------------------------
249
     key.shift_ctrl_left: ;///// GO TO PREVIOUS WORD, WITH SELECTION /////////
249
     key.shift_ctrl_left: ;///// GO TO PREVIOUS WORD, WITH SELECTION /////////
250
;-----------------------------------------------------------------------------
250
;-----------------------------------------------------------------------------
251
	mov	ebx,[cur_tab.Editor.Caret.Y] ;! ebx,[pos.y]
251
	mov	ebx,[cur_editor.Caret.Y] ;! ebx,[pos.y]
252
	mov	edx,[cur_tab.Editor.Caret.X] ;! edx,[pos.x]
252
	mov	edx,[cur_editor.Caret.X] ;! edx,[pos.x]
253
	cld
253
	cld
254
	mov	ecx,ebx
254
	mov	ecx,ebx
255
	call	get_line_offset
255
	call	get_line_offset
256
  .lp1: cmp	dx,[esi]
256
  .lp1: cmp	dx,[esi]
Line 305... Line 305...
305
	movzx	edx,word[esi]
305
	movzx	edx,word[esi]
306
	dec	edx
306
	dec	edx
307
	jmp	.lp2
307
	jmp	.lp2
308
    @@:
308
    @@:
309
	inc	edx
309
	inc	edx
310
	mov	[cur_tab.Editor.Caret.Y],ebx ;! [pos.y],ebx
310
	mov	[cur_editor.Caret.Y],ebx ;! [pos.y],ebx
311
	mov	[cur_tab.Editor.Caret.X],edx ;! [pos.x],edx
311
	mov	[cur_editor.Caret.X],edx ;! [pos.x],edx
312
	test	byte[shi+2],0x01
312
	test	byte[shi+2],0x01
313
	jnz	@f
313
	jnz	@f
314
	mov	[cur_tab.Editor.SelStart.Y],ebx ;! [sel.y],ebx
314
	mov	[cur_editor.SelStart.Y],ebx ;! [sel.y],ebx
315
	mov	[cur_tab.Editor.SelStart.X],edx ;! [sel.x],edx
315
	mov	[cur_editor.SelStart.X],edx ;! [sel.x],edx
316
    @@: sub	ebx,[cur_tab.Editor.TopLeft.Y] ;! ebx,[top_line]
316
    @@: sub	ebx,[cur_editor.TopLeft.Y] ;! ebx,[top_line]
317
	jge	@f
317
	jge	@f
318
	add	[cur_tab.Editor.TopLeft.Y],ebx ;! [top_line],ebx
318
	add	[cur_editor.TopLeft.Y],ebx ;! [top_line],ebx
319
    @@: mov	eax,edx
319
    @@: mov	eax,edx
320
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
320
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
321
	cmp	eax,[columns.scr]
321
	cmp	eax,[columns.scr]
322
	jl	@f
322
	jl	@f
323
	sub	eax,[columns.scr]
323
	sub	eax,[columns.scr]
324
	inc	eax
324
	inc	eax
325
	add	[cur_tab.Editor.TopLeft.X],eax ;! [left_col],eax
325
	add	[cur_editor.TopLeft.X],eax ;! [left_col],eax
326
	jmp	.exit
326
	jmp	.exit
327
    @@: cmp	edx,[cur_tab.Editor.TopLeft.X] ;! edx,[left_col]
327
    @@: cmp	edx,[cur_editor.TopLeft.X] ;! edx,[left_col]
328
	jge	.exit
328
	jge	.exit
329
	mov	[cur_tab.Editor.TopLeft.X],edx ;! [left_col],edx
329
	mov	[cur_editor.TopLeft.X],edx ;! [left_col],edx
330
  .exit:
330
  .exit:
331
	call	draw_file
331
	call	draw_file
332
  .exit.2:
332
  .exit.2:
333
	ret
333
	ret
334
endf
334
endf
Line 339... Line 339...
339
	call	clear_selection
339
	call	clear_selection
Line 340... Line 340...
340
 
340
 
341
;-----------------------------------------------------------------------------
341
;-----------------------------------------------------------------------------
342
     key.shift_ctrl_right: ;///// GO TO NEXT WORD, WITH SELECTION ////////////
342
     key.shift_ctrl_right: ;///// GO TO NEXT WORD, WITH SELECTION ////////////
343
;-----------------------------------------------------------------------------
343
;-----------------------------------------------------------------------------
344
	mov	ebx,[cur_tab.Editor.Caret.Y] ;! ebx,[pos.y]
344
	mov	ebx,[cur_editor.Caret.Y] ;! ebx,[pos.y]
345
	mov	edx,[cur_tab.Editor.Caret.X] ;! edx,[pos.x]
345
	mov	edx,[cur_editor.Caret.X] ;! edx,[pos.x]
346
	cld
346
	cld
347
  .lp1: mov	ecx,ebx
347
  .lp1: mov	ecx,ebx
348
	call	get_line_offset
348
	call	get_line_offset
349
	movzx	ecx,word[esi]
349
	movzx	ecx,word[esi]
Line 361... Line 361...
361
	je	@f
361
	je	@f
362
	inc	edx
362
	inc	edx
363
	dec	ecx
363
	dec	ecx
364
	jnz	@b
364
	jnz	@b
365
  .nx1: inc	ebx
365
  .nx1: inc	ebx
366
	cmp	ebx,[cur_tab.Editor.Lines] ;! ebx,[lines]
366
	cmp	ebx,[cur_editor.Lines.Count] ;! ebx,[lines]
367
	jge	.exit.2
367
	jge	.exit.2
368
	xor	edx,edx
368
	xor	edx,edx
369
	jmp	.lp1
369
	jmp	.lp1
370
    @@:
370
    @@:
Line 386... Line 386...
386
	jne	@f
386
	jne	@f
387
	inc	edx
387
	inc	edx
388
	dec	ecx
388
	dec	ecx
389
	jnz	@b
389
	jnz	@b
390
  .nx2: inc	ebx
390
  .nx2: inc	ebx
391
	cmp	ebx,[cur_tab.Editor.Lines] ;! ebx,[lines]
391
	cmp	ebx,[cur_editor.Lines.Count] ;! ebx,[lines]
392
	jge	.exit.2
392
	jge	.exit.2
393
	xor	edx,edx
393
	xor	edx,edx
394
	jmp	.lp2
394
	jmp	.lp2
395
    @@:
395
    @@:
396
	mov	[cur_tab.Editor.Caret.Y],ebx ;! [pos.y],ebx
396
	mov	[cur_editor.Caret.Y],ebx ;! [pos.y],ebx
397
	mov	[cur_tab.Editor.Caret.X],edx ;! [pos.x],edx
397
	mov	[cur_editor.Caret.X],edx ;! [pos.x],edx
398
	test	byte[shi+2],0x01
398
	test	byte[shi+2],0x01
399
	jnz	@f
399
	jnz	@f
400
	mov	[cur_tab.Editor.SelStart.Y],ebx ;! [sel.y],ebx
400
	mov	[cur_editor.SelStart.Y],ebx ;! [sel.y],ebx
401
	mov	[cur_tab.Editor.SelStart.X],edx ;! [sel.x],edx
401
	mov	[cur_editor.SelStart.X],edx ;! [sel.x],edx
402
    @@: sub	ebx,[cur_tab.Editor.TopLeft.Y] ;! ebx,[top_line]
402
    @@: sub	ebx,[cur_editor.TopLeft.Y] ;! ebx,[top_line]
403
	cmp	ebx,[lines.scr]
403
	cmp	ebx,[lines.scr]
404
	jl	@f
404
	jl	@f
405
	sub	ebx,[lines.scr]
405
	sub	ebx,[lines.scr]
406
	inc	ebx
406
	inc	ebx
407
	add	[cur_tab.Editor.TopLeft.Y],ebx ;! [top_line],ebx
407
	add	[cur_editor.TopLeft.Y],ebx ;! [top_line],ebx
408
    @@: mov	eax,edx
408
    @@: mov	eax,edx
409
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
409
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
410
	cmp	eax,[columns.scr]
410
	cmp	eax,[columns.scr]
411
	jl	@f
411
	jl	@f
412
	sub	eax,[columns.scr]
412
	sub	eax,[columns.scr]
413
	inc	eax
413
	inc	eax
414
	add	[cur_tab.Editor.TopLeft.X],eax ;! [left_col],eax
414
	add	[cur_editor.TopLeft.X],eax ;! [left_col],eax
415
	jmp	.exit
415
	jmp	.exit
416
    @@: cmp	edx,[cur_tab.Editor.TopLeft.X] ;! edx,[left_col]
416
    @@: cmp	edx,[cur_editor.TopLeft.X] ;! edx,[left_col]
417
	jge	.exit
417
	jge	.exit
418
	mov	[cur_tab.Editor.TopLeft.X],edx ;! [left_col],edx
418
	mov	[cur_editor.TopLeft.X],edx ;! [left_col],edx
419
  .exit:
419
  .exit:
420
	call	draw_file
420
	call	draw_file
421
  .exit.2:
421
  .exit.2:
422
	ret
422
	ret
423
endf
423
endf
Line 426... Line 426...
426
func key.ctrl_x
426
func key.ctrl_x
427
	cmp	[sel.selected],0
427
	cmp	[sel.selected],0
428
	je	@f
428
	je	@f
429
	call	key.ctrl_c
429
	call	key.ctrl_c
430
	call	key.del
430
	call	key.del
431
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
431
	mov	[cur_editor.Modified],1 ;! [modified],1
432
    @@: ret
432
    @@: ret
433
endf
433
endf
Line 434... Line 434...
434
 
434
 
435
;-----------------------------------------------------------------------------
435
;-----------------------------------------------------------------------------
Line 535... Line 535...
535
	cmp	[copy_size],0
535
	cmp	[copy_size],0
536
	je	.exit
536
	je	.exit
Line 537... Line 537...
537
 
537
 
Line 538... Line 538...
538
	call	delete_selection
538
	call	delete_selection
539
 
539
 
540
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
540
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
541
	call	get_line_offset
541
	call	get_line_offset
542
	pushd	[esi] esi
542
	pushd	[esi] esi
543
	mov	ecx,[cur_tab.Editor.Caret.X] ;! ecx,[pos.x]
543
	mov	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
544
	call	line_add_spaces
544
	call	line_add_spaces
545
	mov	ecx,[copy_size]
545
	mov	ecx,[copy_size]
546
	sub	ecx,4
546
	sub	ecx,4
547
	mov	edi,[cur_tab.Editor.Data] ;! AREA_TEMP2
547
	mov	edi,[cur_editor.Lines] ;! AREA_TEMP2
548
	add	edi,[edi-4]
548
	add	edi,[edi-4]
549
	dec	edi
549
	dec	edi
550
	mov	eax,esi
550
	mov	eax,esi
551
	mov	esi,edi
551
	mov	esi,edi
552
	sub	esi,ecx
552
	sub	esi,ecx
553
	lea	ecx,[eax+4]
553
	lea	ecx,[eax+4]
554
	add	ecx,[cur_tab.Editor.Caret.X] ;! ecx,[pos.x]
554
	add	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
555
	neg	ecx
555
	neg	ecx
556
	lea	ecx,[esi+ecx+1]
556
	lea	ecx,[esi+ecx+1]
Line 565... Line 565...
565
	pop	edi
565
	pop	edi
566
	add	edi,4
566
	add	edi,4
567
	mov	esi,[copy_buf] ;! AREA_CBUF
567
	mov	esi,[copy_buf] ;! AREA_CBUF
568
	lodsd
568
	lodsd
Line 569... Line 569...
569
 
569
 
570
	mov	ebx,[cur_tab.Editor.Caret.X] ;! ebx,[pos.x]
570
	mov	ebx,[cur_editor.Caret.X] ;! ebx,[pos.x]
571
	add	eax,ebx
571
	add	eax,ebx
572
	mov	[edi-4],ax
572
	mov	[edi-4],ax
573
	sub	eax,ebx
573
	sub	eax,ebx
574
	call	.check_columns
574
	call	.check_columns
Line 588... Line 588...
588
	add	[edi-4],cx
588
	add	[edi-4],cx
589
	call	.check_columns
589
	call	.check_columns
590
	mov	ecx,eax
590
	mov	ecx,eax
591
	rep	movsb
591
	rep	movsb
Line 592... Line 592...
592
 
592
 
593
	mov	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
593
	mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
594
	mov	[cur_tab.Editor.SelStart.X],eax ;! [sel.x],eax
594
	mov	[cur_editor.SelStart.X],eax ;! [sel.x],eax
595
	mov	eax,[copy_count]
595
	mov	eax,[copy_count]
596
	dec	eax
596
	dec	eax
597
	add	[cur_tab.Editor.Caret.Y],eax ;! [pos.y],eax
597
	add	[cur_editor.Caret.Y],eax ;! [pos.y],eax
598
	add	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
598
	add	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
Line 599... Line 599...
599
	add	[cur_tab.Editor.Lines],eax ;! [lines],eax
599
	add	[cur_editor.Lines.Count],eax ;! [lines],eax
600
 
600
 
601
	call	check_inv_all
601
	call	check_inv_all
Line 602... Line 602...
602
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
602
	mov	[cur_editor.Modified],1 ;! [modified],1
603
	jmp	.exit
603
	jmp	.exit
604
 
604
 
Line 610... Line 610...
610
	lodsd
610
	lodsd
611
	add	[edi-4],ax
611
	add	[edi-4],ax
612
	and	dword[edi-4],not 0x00020000
612
	and	dword[edi-4],not 0x00020000
613
	or	dword[edi-4],0x00010000
613
	or	dword[edi-4],0x00010000
614
	call	.check_columns
614
	call	.check_columns
615
	add	edi,[cur_tab.Editor.Caret.X] ;! edi,[pos.x]
615
	add	edi,[cur_editor.Caret.X] ;! edi,[pos.x]
616
	add	esp,4
616
	add	esp,4
617
	mov	ecx,eax
617
	mov	ecx,eax
618
	rep	movsb
618
	rep	movsb
Line 619... Line 619...
619
 
619
 
620
	add	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
620
	add	[cur_editor.Caret.X],eax ;! [pos.x],eax
Line 621... Line 621...
621
	add	[cur_tab.Editor.SelStart.X],eax ;! [sel.x],eax
621
	add	[cur_editor.SelStart.X],eax ;! [sel.x],eax
622
 
622
 
Line 623... Line 623...
623
	call	check_inv_all
623
	call	check_inv_all
624
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
624
	mov	[cur_editor.Modified],1 ;! [modified],1
Line 625... Line 625...
625
 
625
 
626
  .exit:
626
  .exit:
627
	ret
627
	ret
628
 
628
 
629
  .check_columns:
629
  .check_columns:
630
	push	eax
630
	push	eax
631
	movzx	eax,word[edi-4]
631
	movzx	eax,word[edi-4]
632
	cmp	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
632
	cmp	eax,[cur_editor.Columns.Count] ;! eax,[columns]
633
	jbe	@f
633
	jbe	@f
634
	mov	[cur_tab.Editor.Columns],eax ;! [columns],eax
634
	mov	[cur_editor.Columns.Count],eax ;! [columns],eax
635
    @@: pop	eax
635
    @@: pop	eax
Line 654... Line 654...
654
endf
654
endf
Line 655... Line 655...
655
 
655
 
656
;-----------------------------------------------------------------------------
656
;-----------------------------------------------------------------------------
657
func key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
657
func key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
658
;-----------------------------------------------------------------------------
658
;-----------------------------------------------------------------------------
659
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
659
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
660
	call	get_line_offset
660
	call	get_line_offset
Line 661... Line 661...
661
	mov	ebx,esi
661
	mov	ebx,esi
662
 
662
 
663
	mov	ecx,[cur_tab.Editor.Lines] ;! ecx,[lines]
663
	mov	ecx,[cur_editor.Lines.Count] ;! ecx,[lines]
664
	call	get_line_offset
664
	call	get_line_offset
665
	lea	edi,[esi+90+4]
665
	lea	edi,[esi+90+4]
666
	lea	ecx,[esi+4]
666
	lea	ecx,[esi+4]
Line 677... Line 677...
677
	mov	al,' '
677
	mov	al,' '
678
	mov	ecx,10
678
	mov	ecx,10
679
	rep	stosb
679
	rep	stosb
680
	mov	byte[ebx+4],';'
680
	mov	byte[ebx+4],';'
Line 681... Line 681...
681
 
681
 
682
	inc	[cur_tab.Editor.Lines] ;! [lines]
682
	inc	[cur_editor.Lines.Count] ;! [lines]
683
	inc	[cur_tab.Editor.Caret.Y] ;! [pos.y]
683
	inc	[cur_editor.Caret.Y] ;! [pos.y]
Line 684... Line 684...
684
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y] ;! [sel.y],[pos.y]
684
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
685
 
685
 
Line 686... Line 686...
686
	call	check_inv_all
686
	call	check_inv_all
687
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
687
	mov	[cur_editor.Modified],1 ;! [modified],1
688
 
688
 
Line 689... Line 689...
689
  .exit:
689
  .exit:
690
	ret
690
	ret
691
endf
691
endf
692
 
692
 
693
;-----------------------------------------------------------------------------
693
;-----------------------------------------------------------------------------
694
func key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
694
func key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
695
;-----------------------------------------------------------------------------
695
;-----------------------------------------------------------------------------
Line 696... Line 696...
696
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
696
	mov	eax,[cur_editor.Caret.Y] ;! eax,[pos.y]
697
	inc	eax
697
	inc	eax
698
	cmp	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
698
	cmp	eax,[cur_editor.Lines.Count] ;! eax,[lines]
699
	jge	.exit
699
	jge	.exit
700
 
700
 
Line 701... Line 701...
701
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
701
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
702
	call	get_line_offset
702
	call	get_line_offset
703
	mov	edi,esi
703
	mov	edi,esi
704
	lodsd
704
	lodsd
705
	add	esi,eax
705
	add	esi,eax
706
 
706
 
707
	dec	[cur_tab.Editor.Lines] ;! [lines]
707
	dec	[cur_editor.Lines.Count] ;! [lines]
708
	mov	ecx,[temp_buf] ;! AREA_TEMP2
708
	mov	ecx,[temp_buf] ;! AREA_TEMP2
Line 709... Line 709...
709
	sub	ecx,esi
709
	sub	ecx,esi
710
	shr	ecx,2		       ;// fixed (was 4)
710
	shr	ecx,2		       ;// fixed (was 4)
711
	cld
711
	cld
Line 723... Line 723...
723
	call	clear_selection
723
	call	clear_selection
Line 724... Line 724...
724
 
724
 
725
;-----------------------------------------------------------------------------
725
;-----------------------------------------------------------------------------
726
     key.shift_up: ;///// GO TO PREVIOUS LINE, WITH SELECTION ////////////////
726
     key.shift_up: ;///// GO TO PREVIOUS LINE, WITH SELECTION ////////////////
727
;-----------------------------------------------------------------------------
727
;-----------------------------------------------------------------------------
728
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
728
	mov	eax,[cur_editor.Caret.Y] ;! eax,[pos.y]
729
	dec	eax
729
	dec	eax
730
	jns	@f
730
	jns	@f
731
	xor	eax,eax
731
	xor	eax,eax
732
    @@: mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
732
    @@: mov	ecx,[cur_editor.TopLeft.Y] ;! ecx,[top_line]
733
	cmp	eax,ecx
733
	cmp	eax,ecx
734
	jae	@f
734
	jae	@f
735
	dec	ecx
735
	dec	ecx
736
	jns	@f
736
	jns	@f
737
	xor	ecx,ecx
737
	xor	ecx,ecx
738
    @@: test	byte[shi+2],0x01
738
    @@: test	byte[shi+2],0x01
739
	jnz	@f
739
	jnz	@f
740
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
740
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
Line 741... Line 741...
741
    @@: call	check_inv_all.skip_init
741
    @@: call	check_inv_all.skip_init
742
 
742
 
743
  .exit:
743
  .exit:
Line 751... Line 751...
751
 
751
 
752
;-----------------------------------------------------------------------------
752
;-----------------------------------------------------------------------------
753
     key.shift_down: ;///// GO TO NEXT LINE, WITH SELECTION //////////////////
753
     key.shift_down: ;///// GO TO NEXT LINE, WITH SELECTION //////////////////
Line 754... Line 754...
754
;-----------------------------------------------------------------------------
754
;-----------------------------------------------------------------------------
755
 
755
 
756
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
756
	mov	eax,[cur_editor.Caret.Y] ;! eax,[pos.y]
757
	inc	eax
757
	inc	eax
758
	cmp	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
758
	cmp	eax,[cur_editor.Lines.Count] ;! eax,[lines]
759
	jb	@f
759
	jb	@f
760
	dec	eax
760
	dec	eax
761
    @@: mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
761
    @@: mov	ecx,[cur_editor.TopLeft.Y] ;! ecx,[top_line]
762
	mov	edx,eax
762
	mov	edx,eax
763
	sub	edx,ecx
763
	sub	edx,ecx
764
	cmp	edx,[lines.scr]
764
	cmp	edx,[lines.scr]
765
	jb	@f
765
	jb	@f
766
	inc	ecx
766
	inc	ecx
767
    @@: test	byte[shi+2],0x01
767
    @@: test	byte[shi+2],0x01
768
	jnz	@f
768
	jnz	@f
Line 769... Line 769...
769
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
769
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
770
    @@: call	check_inv_all.skip_init
770
    @@: call	check_inv_all.skip_init
771
 
771
 
Line 779... Line 779...
779
	call	clear_selection
779
	call	clear_selection
Line 780... Line 780...
780
 
780
 
781
;-----------------------------------------------------------------------------
781
;-----------------------------------------------------------------------------
782
     key.shift_left: ;///// GO TO PREVIOUS CHAR, WITH SELECTION //////////////
782
     key.shift_left: ;///// GO TO PREVIOUS CHAR, WITH SELECTION //////////////
783
;-----------------------------------------------------------------------------
783
;-----------------------------------------------------------------------------
784
	mov	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
784
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
785
	dec	eax
785
	dec	eax
786
	jns	@f
786
	jns	@f
787
	inc	eax
787
	inc	eax
788
    @@: test	byte[shi+2],0x01
788
    @@: test	byte[shi+2],0x01
789
	jnz	@f
789
	jnz	@f
790
	mov	[cur_tab.Editor.SelStart.X],eax ;! [sel.x],eax
790
	mov	[cur_editor.SelStart.X],eax ;! [sel.x],eax
791
    @@: mov	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
791
    @@: mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
Line 792... Line 792...
792
	call	 check_inv_all
792
	call	 check_inv_all
793
 
793
 
794
  .exit:
794
  .exit:
Line 801... Line 801...
801
	call	clear_selection
801
	call	clear_selection
Line 802... Line 802...
802
 
802
 
803
;-----------------------------------------------------------------------------
803
;-----------------------------------------------------------------------------
804
     key.shift_right: ;///// GO TO NEXT CHAR, WITH SELECTION /////////////////
804
     key.shift_right: ;///// GO TO NEXT CHAR, WITH SELECTION /////////////////
805
;-----------------------------------------------------------------------------
805
;-----------------------------------------------------------------------------
806
	mov	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
806
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
807
	inc	eax
807
	inc	eax
808
	cmp	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
808
	cmp	eax,[cur_editor.Columns.Count] ;! eax,[columns]
809
	jbe	@f
809
	jbe	@f
810
	dec	eax
810
	dec	eax
811
    @@: test	byte[shi+2],0x01
811
    @@: test	byte[shi+2],0x01
812
	jnz	@f
812
	jnz	@f
813
	mov	[cur_tab.Editor.SelStart.X],eax ;! [sel.x],eax
813
	mov	[cur_editor.SelStart.X],eax ;! [sel.x],eax
814
    @@: mov	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
814
    @@: mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
Line 815... Line 815...
815
	call	check_inv_all
815
	call	check_inv_all
816
 
816
 
817
  .exit:
817
  .exit:
Line 826... Line 826...
826
;-----------------------------------------------------------------------------
826
;-----------------------------------------------------------------------------
827
     key.shift_pgup: ;///// GO TO PREVIOUS PAGE, WITH SELECTION //////////////
827
     key.shift_pgup: ;///// GO TO PREVIOUS PAGE, WITH SELECTION //////////////
828
;-----------------------------------------------------------------------------
828
;-----------------------------------------------------------------------------
829
	mov	edx,[lines.scr]
829
	mov	edx,[lines.scr]
830
	dec	edx
830
	dec	edx
831
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
831
	mov	eax,[cur_editor.Caret.Y] ;! eax,[pos.y]
832
	mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
832
	mov	ecx,[cur_editor.TopLeft.Y] ;! ecx,[top_line]
833
	sub	eax,edx
833
	sub	eax,edx
834
	jns	@f
834
	jns	@f
835
	xor	eax,eax
835
	xor	eax,eax
836
    @@: sub	ecx,edx
836
    @@: sub	ecx,edx
837
	jns	@f
837
	jns	@f
838
	xor	ecx,ecx
838
	xor	ecx,ecx
839
    @@: test	byte[shi+2],0x01
839
    @@: test	byte[shi+2],0x01
840
	jnz	@f
840
	jnz	@f
841
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
841
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
842
    @@: call	check_inv_all.skip_init
842
    @@: call	check_inv_all.skip_init
Line 843... Line 843...
843
 
843
 
844
  .exit:
844
  .exit:
845
	ret
845
	ret
Line 853... Line 853...
853
;-----------------------------------------------------------------------------
853
;-----------------------------------------------------------------------------
854
     key.shift_pgdn: ;///// GO TO NEXT PAGE, WITH SELECTION //////////////////
854
     key.shift_pgdn: ;///// GO TO NEXT PAGE, WITH SELECTION //////////////////
855
;-----------------------------------------------------------------------------
855
;-----------------------------------------------------------------------------
856
	mov	edx,[lines.scr]
856
	mov	edx,[lines.scr]
857
	dec	edx
857
	dec	edx
858
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
858
	mov	eax,[cur_editor.Caret.Y] ;! eax,[pos.y]
859
	mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
859
	mov	ecx,[cur_editor.TopLeft.Y] ;! ecx,[top_line]
860
	add	eax,edx
860
	add	eax,edx
861
	add	ecx,edx
861
	add	ecx,edx
862
	cmp	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
862
	cmp	eax,[cur_editor.Lines.Count] ;! eax,[lines]
863
	jb	@f
863
	jb	@f
864
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
864
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
865
	dec	eax
865
	dec	eax
866
    @@: test	byte[shi+2],0x01
866
    @@: test	byte[shi+2],0x01
867
	jnz	@f
867
	jnz	@f
868
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
868
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
869
    @@: call	check_inv_all.skip_init
869
    @@: call	check_inv_all.skip_init
Line 870... Line 870...
870
 
870
 
871
  .exit:
871
  .exit:
872
	ret
872
	ret
Line 878... Line 878...
878
	call	clear_selection
878
	call	clear_selection
Line 879... Line 879...
879
 
879
 
880
;-----------------------------------------------------------------------------
880
;-----------------------------------------------------------------------------
881
     key.shift_home: ;///// GO TO LINE START, WITH SELECTION /////////////////
881
     key.shift_home: ;///// GO TO LINE START, WITH SELECTION /////////////////
882
;-----------------------------------------------------------------------------
882
;-----------------------------------------------------------------------------
883
	mov	[cur_tab.Editor.Caret.X],0 ;! [pos.x],0
883
	mov	[cur_editor.Caret.X],0 ;! [pos.x],0
884
	test	byte[shi+2],0x01
884
	test	byte[shi+2],0x01
885
	jnz	@f
885
	jnz	@f
886
	mov	[cur_tab.Editor.SelStart.X],0 ;! [sel.x],0
886
	mov	[cur_editor.SelStart.X],0 ;! [sel.x],0
Line 887... Line 887...
887
    @@: call	check_inv_all
887
    @@: call	check_inv_all
888
 
888
 
889
  .exit:
889
  .exit:
Line 896... Line 896...
896
	call	clear_selection
896
	call	clear_selection
Line 897... Line 897...
897
 
897
 
898
;-----------------------------------------------------------------------------
898
;-----------------------------------------------------------------------------
899
     key.shift_end: ;///// GO TO LINE END, WITH SELECTION ////////////////////
899
     key.shift_end: ;///// GO TO LINE END, WITH SELECTION ////////////////////
900
;-----------------------------------------------------------------------------
900
;-----------------------------------------------------------------------------
901
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
901
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
902
	call	get_line_offset
902
	call	get_line_offset
903
	call	get_real_length
903
	call	get_real_length
904
	mov	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
904
	mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
905
	test	byte[shi+2],0x01
905
	test	byte[shi+2],0x01
906
	jnz	@f
906
	jnz	@f
907
	mov	[cur_tab.Editor.SelStart.X],eax ;! [sel.x],eax
907
	mov	[cur_editor.SelStart.X],eax ;! [sel.x],eax
Line 908... Line 908...
908
    @@: call	check_inv_all
908
    @@: call	check_inv_all
909
 
909
 
910
  .exit:
910
  .exit:
Line 917... Line 917...
917
	call	clear_selection
917
	call	clear_selection
Line 918... Line 918...
918
 
918
 
919
;-----------------------------------------------------------------------------
919
;-----------------------------------------------------------------------------
920
     key.shift_ctrl_home: ;///// GO TO PAGE START, WITH SELECTION ////////////
920
     key.shift_ctrl_home: ;///// GO TO PAGE START, WITH SELECTION ////////////
921
;-----------------------------------------------------------------------------
921
;-----------------------------------------------------------------------------
922
	mov	eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line]
922
	mov	eax,[cur_editor.TopLeft.Y] ;! eax,[top_line]
923
	mov	ecx,eax
923
	mov	ecx,eax
924
	test	byte[shi+2],0x01
924
	test	byte[shi+2],0x01
925
	jnz	@f
925
	jnz	@f
926
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
926
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
Line 927... Line 927...
927
    @@: call	check_inv_all.skip_init
927
    @@: call	check_inv_all.skip_init
928
 
928
 
929
  .exit:
929
  .exit:
Line 936... Line 936...
936
	call	clear_selection
936
	call	clear_selection
Line 937... Line 937...
937
 
937
 
938
;-----------------------------------------------------------------------------
938
;-----------------------------------------------------------------------------
939
     key.shift_ctrl_end: ;///// GO TO PAGE END, WITH SELECTION ///////////////
939
     key.shift_ctrl_end: ;///// GO TO PAGE END, WITH SELECTION ///////////////
940
;-----------------------------------------------------------------------------
940
;-----------------------------------------------------------------------------
941
	mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
941
	mov	ecx,[cur_editor.TopLeft.Y] ;! ecx,[top_line]
942
	mov	eax,[lines.scr]
942
	mov	eax,[lines.scr]
943
	cmp	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
943
	cmp	eax,[cur_editor.Lines.Count] ;! eax,[lines]
944
	jle	@f
944
	jle	@f
945
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
945
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
946
    @@: add	eax,ecx
946
    @@: add	eax,ecx
947
	dec	eax
947
	dec	eax
948
	test	byte[shi+2],0x01
948
	test	byte[shi+2],0x01
949
	jnz	@f
949
	jnz	@f
950
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
950
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
Line 951... Line 951...
951
    @@: call	check_inv_all.skip_init
951
    @@: call	check_inv_all.skip_init
952
 
952
 
953
  .exit:
953
  .exit:
Line 961... Line 961...
961
 
961
 
962
;-----------------------------------------------------------------------------
962
;-----------------------------------------------------------------------------
963
     key.shift_ctrl_pgup: ;///// GO TO DOCUMENT START, WITH SELECTION ////////
963
     key.shift_ctrl_pgup: ;///// GO TO DOCUMENT START, WITH SELECTION ////////
964
;-----------------------------------------------------------------------------
964
;-----------------------------------------------------------------------------
965
	xor	eax,eax
965
	xor	eax,eax
966
	mov	[cur_tab.Editor.TopLeft.Y],eax ;! [top_line],eax
966
	mov	[cur_editor.TopLeft.Y],eax ;! [top_line],eax
967
	mov	[cur_tab.Editor.Caret.Y],eax ;! [pos.y],eax
967
	mov	[cur_editor.Caret.Y],eax ;! [pos.y],eax
968
	test	byte[shi+2],0x01
968
	test	byte[shi+2],0x01
969
	jnz	@f
969
	jnz	@f
970
	mov	[cur_tab.Editor.SelStart.Y],eax ;! [sel.y],eax
970
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
Line 971... Line 971...
971
    @@: call	check_inv_all.skip_check
971
    @@: call	check_inv_all.skip_check
972
 
972
 
973
  .exit:
973
  .exit:
Line 980... Line 980...
980
	call	clear_selection
980
	call	clear_selection
Line 981... Line 981...
981
 
981
 
982
;-----------------------------------------------------------------------------
982
;-----------------------------------------------------------------------------
983
     key.shift_ctrl_pgdn: ;///// GO TO DOCUMENT END, WITH SELECTION //////////
983
     key.shift_ctrl_pgdn: ;///// GO TO DOCUMENT END, WITH SELECTION //////////
984
;-----------------------------------------------------------------------------
984
;-----------------------------------------------------------------------------
985
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]    ; eax = lines in the file
985
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]    ; eax = lines in the file
986
	mov	[cur_tab.Editor.Caret.Y],eax ;! [pos.y],eax
986
	mov	[cur_editor.Caret.Y],eax ;! [pos.y],eax
987
	sub	eax,[lines.scr]   ; eax -= lines on the screen
987
	sub	eax,[lines.scr]   ; eax -= lines on the screen
988
	jns	@f
988
	jns	@f
989
	xor	eax,eax
989
	xor	eax,eax
990
    @@: mov	[cur_tab.Editor.TopLeft.Y],eax ;! [top_line],eax
990
    @@: mov	[cur_editor.TopLeft.Y],eax ;! [top_line],eax
991
	dec	[cur_tab.Editor.Caret.Y] ;! [pos.y]
991
	dec	[cur_editor.Caret.Y] ;! [pos.y]
992
	test	byte[shi+2],0x01
992
	test	byte[shi+2],0x01
993
	jnz	@f
993
	jnz	@f
994
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y]
994
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y]
995
;!      push    [pos.y]
995
;!      push    [pos.y]
996
;!      pop     [sel.y]
996
;!      pop     [sel.y]
Line 997... Line 997...
997
    @@: call	check_inv_all.skip_check
997
    @@: call	check_inv_all.skip_check
Line 1004... Line 1004...
1004
func key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
1004
func key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
1005
;-----------------------------------------------------------------------------
1005
;-----------------------------------------------------------------------------
1006
	call	delete_selection
1006
	call	delete_selection
1007
	jnc	.exit.2
1007
	jnc	.exit.2
Line 1008... Line 1008...
1008
 
1008
 
1009
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
1009
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1010
	call	get_line_offset
1010
	call	get_line_offset
1011
	and	dword[esi],not 0x00020000
1011
	and	dword[esi],not 0x00020000
1012
	or	dword[esi],0x00010000
1012
	or	dword[esi],0x00010000
1013
	lea	ebx,[esi+4]
1013
	lea	ebx,[esi+4]
Line 1014... Line 1014...
1014
	mov	ebp,esi
1014
	mov	ebp,esi
1015
 
1015
 
1016
	call	get_real_length
1016
	call	get_real_length
Line 1017... Line 1017...
1017
	or	eax,eax
1017
	or	eax,eax
1018
	je	.line_up
1018
	je	.line_up
1019
 
1019
 
1020
	mov	ecx,[cur_tab.Editor.Caret.X] ;! ecx,[pos.x]
1020
	mov	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
1021
	cmp	ecx,eax
1021
	cmp	ecx,eax
1022
	jae	.line_up
1022
	jae	.line_up
1023
	lea	edi,[ebx+ecx]
1023
	lea	edi,[ebx+ecx]
1024
	neg	ecx
1024
	neg	ecx
1025
	movzx	eax,word[ebp]
1025
	movzx	eax,word[ebp]
Line 1026... Line 1026...
1026
	add	ecx,eax;[ebp]
1026
	add	ecx,eax;[ebp]
1027
	repe	scasb
1027
	repe	scasb
1028
	je	.line_up
1028
	je	.line_up
1029
 
1029
 
1030
	mov	edi,ebx
1030
	mov	edi,ebx
1031
	mov	ecx,[cur_tab.Editor.Caret.X] ;! ecx,[pos.x]
1031
	mov	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
1032
	add	edi,ecx
1032
	add	edi,ecx
1033
	lea	esi,[edi+1]
1033
	lea	esi,[edi+1]
1034
	neg	ecx
1034
	neg	ecx
1035
	movzx	eax,word[ebp]
1035
	movzx	eax,word[ebp]
Line 1036... Line 1036...
1036
	add	ecx,eax;[ebp]
1036
	add	ecx,eax;[ebp]
1037
	dec	ecx
1037
	dec	ecx
1038
	rep	movsb
1038
	rep	movsb
1039
	mov	byte[edi],' '
1039
	mov	byte[edi],' '
1040
 
1040
 
Line 1041... Line 1041...
1041
	m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
1041
	m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
1042
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y] ;! [sel.y],[pos.y]
1042
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
1043
	call	check_inv_all
1043
	call	check_inv_all
1044
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
1044
	mov	[cur_editor.Modified],1 ;! [modified],1
1045
	ret
1045
	ret
1046
 
1046
 
1047
  .line_up:
1047
  .line_up:
1048
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
1048
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
1049
	dec	eax
1049
	dec	eax
1050
	cmp	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
1050
	cmp	eax,[cur_editor.Caret.Y] ;! eax,[pos.y]
1051
	je	.exit
1051
	je	.exit
1052
	mov	edi,[temp_buf] ;! AREA_TEMP+4
1052
	mov	edi,[temp_buf] ;! AREA_TEMP+4
1053
	add	edi,4
1053
	add	edi,4
1054
	mov	esi,ebx
1054
	mov	esi,ebx
1055
	mov	ecx,[cur_tab.Editor.Caret.X] ;! ecx,[pos.x]
1055
	mov	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
1056
	rep	movsb
1056
	rep	movsb
Line 1076... Line 1076...
1076
	mov	ecx,edi ;! [edi-AREA_TEMP]
1076
	mov	ecx,edi ;! [edi-AREA_TEMP]
1077
	sub	ecx,[temp_buf]
1077
	sub	ecx,[temp_buf]
Line 1078... Line 1078...
1078
 
1078
 
1079
	mov	esi,[temp_buf] ;! AREA_TEMP
1079
	mov	esi,[temp_buf] ;! AREA_TEMP
1080
	call	get_real_length
1080
	call	get_real_length
1081
	cmp	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
1081
	cmp	eax,[cur_editor.Columns.Count] ;! eax,[columns]
1082
	jbe	@f
1082
	jbe	@f
1083
	mov	[cur_tab.Editor.Columns],eax ;! [columns],eax
1083
	mov	[cur_editor.Columns.Count],eax ;! [columns],eax
1084
    @@:
1084
    @@:
1085
	push	ecx
1085
	push	ecx
1086
	mov	edi,[cur_tab.Editor.Data] ;! AREA_TEMP2
1086
	mov	edi,[cur_editor.Lines] ;! AREA_TEMP2
1087
	add	edi,[edi-4]
1087
	add	edi,[edi-4]
1088
	dec	edi
1088
	dec	edi
1089
	lea	esi,[edi+8]
1089
	lea	esi,[edi+8]
1090
	sub	esi,ecx
1090
	sub	esi,ecx
Line 1106... Line 1106...
1106
	lea	esi,[ebp+8]
1106
	lea	esi,[ebp+8]
1107
	movzx	eax,word[esi-8]
1107
	movzx	eax,word[esi-8]
1108
	add	esi,eax;[esi-8]
1108
	add	esi,eax;[esi-8]
1109
	movzx	eax,word[esi-4]
1109
	movzx	eax,word[esi-4]
1110
	add	esi,eax;[esi-4]
1110
	add	esi,eax;[esi-4]
1111
	mov	ecx,[cur_tab.Editor.Data] ;! AREA_TEMP2
1111
	mov	ecx,[cur_editor.Lines] ;! AREA_TEMP2
1112
	add	ecx,[ecx-4]
1112
	add	ecx,[ecx-4]
1113
	sub	ecx,esi
1113
	sub	ecx,esi
1114
	cld
1114
	cld
1115
    @@: rep	movsb
1115
    @@: rep	movsb
1116
  .lp1: pop	ecx
1116
  .lp1: pop	ecx
Line 1118... Line 1118...
1118
	mov	edi,ebp
1118
	mov	edi,ebp
1119
	cld
1119
	cld
1120
	rep	movsb
1120
	rep	movsb
Line 1121... Line 1121...
1121
 
1121
 
1122
  .ok.dec.lines:
1122
  .ok.dec.lines:
1123
	dec	[cur_tab.Editor.Lines] ;! [lines]
1123
	dec	[cur_editor.Lines.Count] ;! [lines]
1124
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
1124
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
1125
	cmp	[cur_tab.Editor.Caret.Y],eax ;! [pos.y],eax
1125
	cmp	[cur_editor.Caret.Y],eax ;! [pos.y],eax
1126
	jb	@f
1126
	jb	@f
1127
	dec	eax
1127
	dec	eax
1128
	mov	[cur_tab.Editor.Caret.Y],eax ;! [pos.y],eax
1128
	mov	[cur_editor.Caret.Y],eax ;! [pos.y],eax
1129
    @@: m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
1129
    @@: m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
Line 1130... Line 1130...
1130
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y] ;! [sel.y],[pos.y]
1130
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
1131
 
1131
 
1132
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
1132
	mov	[cur_editor.Modified],1 ;! [modified],1
Line 1133... Line 1133...
1133
  .exit.2:
1133
  .exit.2:
1134
	call	check_inv_all
1134
	call	check_inv_all
Line 1150... Line 1150...
1150
func key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
1150
func key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
1151
;-----------------------------------------------------------------------------
1151
;-----------------------------------------------------------------------------
1152
	call	delete_selection
1152
	call	delete_selection
1153
	jnc	key.del.exit.2
1153
	jnc	key.del.exit.2
Line 1154... Line 1154...
1154
 
1154
 
1155
	mov	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
1155
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1156
	dec	eax
1156
	dec	eax
Line 1157... Line 1157...
1157
	js	.line_up
1157
	js	.line_up
1158
 
1158
 
1159
	dec	[cur_tab.Editor.Caret.X] ;! [pos.x]
1159
	dec	[cur_editor.Caret.X] ;! [pos.x]
1160
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
1160
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1161
	call	get_line_offset
1161
	call	get_line_offset
Line 1162... Line 1162...
1162
	and	dword[esi],not 0x00020000
1162
	and	dword[esi],not 0x00020000
1163
	or	dword[esi],0x00010000
1163
	or	dword[esi],0x00010000
1164
 
1164
 
1165
	mov	ebx,eax
1165
	mov	ebx,eax
1166
	call	get_real_length
1166
	call	get_real_length
1167
	cmp	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
1167
	cmp	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1168
	jae	@f
1168
	jae	@f
1169
	m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
1169
	m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
Line 1170... Line 1170...
1170
	call	check_inv_all
1170
	call	check_inv_all
1171
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
1171
	mov	[cur_editor.Modified],1 ;! [modified],1
1172
	ret
1172
	ret
Line 1180... Line 1180...
1180
	lea	esi,[edi+1]
1180
	lea	esi,[edi+1]
1181
	cld
1181
	cld
1182
	rep	movsb
1182
	rep	movsb
1183
	mov	byte[edi],' '
1183
	mov	byte[edi],' '
Line 1184... Line 1184...
1184
 
1184
 
1185
	m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
1185
	m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
1186
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y] ;! [sel.y],[pos.y]
1186
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
1187
	call	check_inv_str
1187
	call	check_inv_str
1188
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
1188
	mov	[cur_editor.Modified],1 ;! [modified],1
Line 1189... Line 1189...
1189
	ret
1189
	ret
1190
 
1190
 
1191
  .line_up:
1191
  .line_up:
1192
	cmp	[cur_tab.Editor.Caret.Y],0 ;! [pos.y],0
1192
	cmp	[cur_editor.Caret.Y],0 ;! [pos.y],0
1193
	jne	@f
1193
	jne	@f
1194
	ret
1194
	ret
1195
    @@: mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
1195
    @@: mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1196
	dec	ecx
1196
	dec	ecx
1197
	call	get_line_offset
1197
	call	get_line_offset
Line 1203... Line 1203...
1203
	movzx	ecx,word[ebp]
1203
	movzx	ecx,word[ebp]
1204
    @@: cmp	byte[ebx+ecx-1],' '
1204
    @@: cmp	byte[ebx+ecx-1],' '
1205
	jne	@f
1205
	jne	@f
1206
	dec	ecx
1206
	dec	ecx
1207
	jg	@b
1207
	jg	@b
1208
    @@: mov	[cur_tab.Editor.Caret.X],ecx ;! [pos.x],ecx
1208
    @@: mov	[cur_editor.Caret.X],ecx ;! [pos.x],ecx
1209
	dec	[cur_tab.Editor.Caret.Y] ;! [pos.y]
1209
	dec	[cur_editor.Caret.Y] ;! [pos.y]
1210
	cld
1210
	cld
1211
	jmp	key.del.line_up
1211
	jmp	key.del.line_up
1212
endf
1212
endf
Line 1213... Line 1213...
1213
 
1213
 
1214
;-----------------------------------------------------------------------------
1214
;-----------------------------------------------------------------------------
1215
func key.tab ;///// TABULATE /////////////////////////////////////////////////
1215
func key.tab ;///// TABULATE /////////////////////////////////////////////////
1216
;-----------------------------------------------------------------------------
1216
;-----------------------------------------------------------------------------
1217
	call	delete_selection
1217
	call	delete_selection
Line 1218... Line 1218...
1218
	mov	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
1218
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1219
 
1219
 
1220
	mov	ecx,eax
1220
	mov	ecx,eax
1221
	add	eax,ATABW
1221
	add	eax,ATABW
1222
	and	eax,not(ATABW-1)
1222
	and	eax,not(ATABW-1)
1223
	push	eax ' '
1223
	push	eax ' '
1224
	sub	eax,ecx
1224
	sub	eax,ecx
1225
  .direct:
1225
  .direct:
1226
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
1226
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1227
	call	get_line_offset
1227
	call	get_line_offset
Line 1228... Line 1228...
1228
	and	dword[esi],not 0x00020000
1228
	and	dword[esi],not 0x00020000
Line 1229... Line 1229...
1229
	or	dword[esi],0x00010000
1229
	or	dword[esi],0x00010000
1230
 
1230
 
1231
	xchg	eax,ecx
1231
	xchg	eax,ecx
1232
 
1232
 
1233
	call	get_real_length
1233
	call	get_real_length
1234
	cmp	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
1234
	cmp	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1235
	jae	@f
1235
	jae	@f
1236
	mov	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
1236
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1237
    @@: movzx	edx,word[esi]
1237
    @@: movzx	edx,word[esi]
1238
	sub	edx,eax
1238
	sub	edx,eax
1239
	cmp	ecx,edx
1239
	cmp	ecx,edx
1240
	jl	@f
1240
	jl	@f
1241
	pushad; esi ecx eax
1241
	pushad; esi ecx eax
1242
	mov	ecx,[cur_tab.Editor.Data] ;! AREA_TEMP2-10+1
1242
	mov	ecx,[cur_editor.Lines] ;! AREA_TEMP2-10+1
1243
	add	ecx,[ecx-4]
1243
	add	ecx,[ecx-4]
Line 1266... Line 1266...
1266
	lea	edi,[ebx+edi-1]
1266
	lea	edi,[ebx+edi-1]
1267
	mov	esi,edi
1267
	mov	esi,edi
1268
	sub	esi,ecx
1268
	sub	esi,ecx
1269
	lea	ecx,[esi+1]
1269
	lea	ecx,[esi+1]
1270
	sub	ecx,ebx
1270
	sub	ecx,ebx
1271
	sub	ecx,[cur_tab.Editor.Caret.X] ;! ecx,[pos.x]
1271
	sub	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
1272
	std
1272
	std
1273
	rep	movsb
1273
	rep	movsb
1274
  .ok:	pop	ecx		;*******
1274
  .ok:	pop	ecx		;*******
1275
	pop	eax
1275
	pop	eax
1276
	rep	stosb
1276
	rep	stosb
1277
	cld
1277
	cld
1278
	pop	[cur_tab.Editor.Caret.X] ;! [pos.x]
1278
	pop	[cur_editor.Caret.X] ;! [pos.x]
1279
	lea	esi,[ebx-4]
1279
	lea	esi,[ebx-4]
1280
	call	get_real_length
1280
	call	get_real_length
1281
	cmp	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
1281
	cmp	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1282
	jae	@f
1282
	jae	@f
1283
	mov	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
1283
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1284
    @@: cmp	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
1284
    @@: cmp	eax,[cur_editor.Columns.Count] ;! eax,[columns]
1285
	jbe	@f
1285
	jbe	@f
1286
	mov	[cur_tab.Editor.Columns],eax ;! [columns],eax
1286
	mov	[cur_editor.Columns.Count],eax ;! [columns],eax
1287
    @@: m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
1287
    @@: m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
1288
	m2m	[cur_tab.Editor.SelStart.Y],[cur_tab.Editor.Caret.Y] ;! [sel.y],[pos.y]
1288
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
1289
	call	check_inv_all
1289
	call	check_inv_all
1290
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
1290
	mov	[cur_editor.Modified],1 ;! [modified],1
Line 1291... Line 1291...
1291
 
1291
 
1292
  .exit:
1292
  .exit:
1293
	ret
1293
	ret
Line 1294... Line 1294...
1294
endf
1294
endf
1295
 
1295
 
1296
;-----------------------------------------------------------------------------
1296
;-----------------------------------------------------------------------------
1297
func key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
1297
func key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
Line 1298... Line 1298...
1298
;-----------------------------------------------------------------------------
1298
;-----------------------------------------------------------------------------
1299
	call	delete_selection
1299
	call	delete_selection
Line 1300... Line 1300...
1300
 
1300
 
1301
	mov	ecx,[cur_tab.Editor.Caret.Y] ;! ecx,[pos.y]
1301
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1302
	call	get_line_offset
1302
	call	get_line_offset
1303
 
1303
 
1304
	mov	ebx,[cur_tab.Editor.Caret.X] ;! ebx,[pos.x]
1304
	mov	ebx,[cur_editor.Caret.X] ;! ebx,[pos.x]
1305
	cmp	bx,[esi]
1305
	cmp	bx,[esi]
Line 1360... Line 1360...
1360
	dec	eax
1360
	dec	eax
1361
	jmp	@f
1361
	jmp	@f
1362
  .lp2: xor	eax,eax
1362
  .lp2: xor	eax,eax
1363
    @@: mov	edx,edi
1363
    @@: mov	edx,edi
1364
	add	edi,4
1364
	add	edi,4
1365
	mov	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
1365
	mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
1366
	jecxz	@f
1366
	jecxz	@f
1367
	push	ecx
1367
	push	ecx
1368
	mov	ecx,eax
1368
	mov	ecx,eax
1369
	mov	al,' '
1369
	mov	al,' '
1370
	rep	stosb
1370
	rep	stosb
Line 1382... Line 1382...
1382
 
1382
 
1383
	mov	ecx,edi ;! [edi-AREA_TEMP]
1383
	mov	ecx,edi ;! [edi-AREA_TEMP]
Line 1384... Line 1384...
1384
	sub	ecx,[temp_buf]
1384
	sub	ecx,[temp_buf]
1385
 
1385
 
1386
	push	ecx
1386
	push	ecx
1387
	mov	edi,[cur_tab.Editor.Data] ;! AREA_TEMP2
1387
	mov	edi,[cur_editor.Lines] ;! AREA_TEMP2
1388
	add	edi,[edi-4]
1388
	add	edi,[edi-4]
1389
	dec	edi
1389
	dec	edi
1390
	lea	esi,[edi+4]
1390
	lea	esi,[edi+4]
Line 1400... Line 1400...
1400
	lea	esi,[ebp+4]
1400
	lea	esi,[ebp+4]
1401
	mov	eax,[esp]
1401
	mov	eax,[esp]
1402
	lea	edi,[esi+eax-4]
1402
	lea	edi,[esi+eax-4]
1403
	movzx	ecx,word[ebp]
1403
	movzx	ecx,word[ebp]
1404
	add	esi,ecx;[ebp]
1404
	add	esi,ecx;[ebp]
1405
	mov	ecx,[cur_tab.Editor.Data] ;! AREA_TEMP2
1405
	mov	ecx,[cur_editor.Lines] ;! AREA_TEMP2
1406
	add	ecx,[ecx-4]
1406
	add	ecx,[ecx-4]
1407
	sub	ecx,esi
1407
	sub	ecx,esi
1408
	cld
1408
	cld
1409
    @@: rep	movsb
1409
    @@: rep	movsb
1410
  .lp3: pop	ecx
1410
  .lp3: pop	ecx
1411
	mov	esi,[temp_buf] ;! AREA_TEMP
1411
	mov	esi,[temp_buf] ;! AREA_TEMP
1412
	mov	edi,ebp
1412
	mov	edi,ebp
1413
	cld
1413
	cld
1414
	rep	movsb
1414
	rep	movsb
Line 1415... Line 1415...
1415
 
1415
 
1416
	inc	[cur_tab.Editor.Caret.Y] ;! [pos.y]
1416
	inc	[cur_editor.Caret.Y] ;! [pos.y]
1417
	inc	[cur_tab.Editor.SelStart.Y] ;! [sel.y]
1417
	inc	[cur_editor.SelStart.Y] ;! [sel.y]
Line 1418... Line 1418...
1418
	inc	[cur_tab.Editor.Lines] ;! [lines]
1418
	inc	[cur_editor.Lines.Count] ;! [lines]
Line 1419... Line 1419...
1419
 
1419
 
1420
	m2m	[cur_tab.Editor.SelStart.X],[cur_tab.Editor.Caret.X] ;! [sel.x],[pos.x]
1420
	m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
Line 1421... Line 1421...
1421
 
1421
 
1422
	call	check_inv_all
1422
	call	check_inv_all
1423
	mov	[cur_tab.Editor.Modified],1 ;! [modified],1
1423
	mov	[cur_editor.Modified],1 ;! [modified],1
Line 1442... Line 1442...
1442
	inc	eax
1442
	inc	eax
1443
	cmp	eax,[tab_bar.Items.Count]
1443
	cmp	eax,[tab_bar.Items.Count]
1444
	jb	@f
1444
	jb	@f
1445
	mov	ebp,[tab_bar.Items]
1445
	mov	ebp,[tab_bar.Items]
1446
    @@: call	set_cur_tab
1446
    @@: call	set_cur_tab
-
 
1447
	call	make_tab_visible
1447
	call	align_editor_in_tab
1448
	call	align_editor_in_tab
1448
	call	draw_editor
1449
	call	draw_editor
1449
	call	draw_tabctl
1450
	call	draw_tabctl
1450
  .exit:
1451
  .exit:
1451
	ret
1452
	ret
Line 1468... Line 1469...
1468
	jge	@f
1469
	jge	@f
1469
	imul	eax,[tab_bar.Items.Count],sizeof.TABITEM
1470
	imul	eax,[tab_bar.Items.Count],sizeof.TABITEM
1470
	add	eax,[tab_bar.Items]
1471
	add	eax,[tab_bar.Items]
1471
	lea	ebp,[eax-sizeof.TABITEM]
1472
	lea	ebp,[eax-sizeof.TABITEM]
1472
    @@: call	set_cur_tab
1473
    @@: call	set_cur_tab
-
 
1474
	call	make_tab_visible
1473
	call	align_editor_in_tab
1475
	call	align_editor_in_tab
1474
	call	draw_editor
1476
	call	draw_editor
1475
	call	draw_tabctl
1477
	call	draw_tabctl
1476
  .exit:
1478
  .exit:
1477
	ret
1479
	ret
1478
endf
1480
endf
-
 
1481
 
-
 
1482
;-----------------------------------------------------------------------------
-
 
1483
func key.ctrl_f4 ;///// CLOSE CURRENT TAB ////////////////////////////////////
-
 
1484
;-----------------------------------------------------------------------------
-
 
1485
	mov	ebp,[tab_bar.Current.Ptr]
-
 
1486
	call	delete_tab
-
 
1487
	cmp	[tab_bar.Items.Count],0
-
 
1488
	jne	@f
-
 
1489
	call	create_tab
-
 
1490
    @@: ret
-
 
1491
endf