Subversion Repositories Kolibri OS

Rev

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

Rev 267 Rev 280
Line 153... Line 153...
153
endf
153
endf
Line 154... Line 154...
154
 
154
 
155
;-----------------------------------------------------------------------------
155
;-----------------------------------------------------------------------------
156
func key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////////////////////
156
func key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////////////////////
-
 
157
;-----------------------------------------------------------------------------
-
 
158
	cmp	[cur_editor.FilePath],'/'
157
;-----------------------------------------------------------------------------
159
	jne	key.shift_ctrl_s
158
	cmp	[cur_editor.Modified],0 ;! [modified],0
160
	cmp	[cur_editor.Modified],0 ;! [modified],0
159
	je	.exit
161
	je	.exit
160
	cmp	[f_info.length],0
162
	;cmp     [f_info.length],0
161
	je	key.shift_ctrl_s
163
	;je      key.shift_ctrl_s
162
	call	save_file
164
	call	save_file
163
	call	drawwindow
165
	call	drawwindow
164
  .exit:
166
  .exit:
Line 535... Line 537...
535
	cmp	[copy_size],0
537
	cmp	[copy_size],0
536
	je	.exit
538
	je	.exit
Line 537... Line 539...
537
 
539
 
Line -... Line 540...
-
 
540
	call	delete_selection
-
 
541
 
-
 
542
	mov	eax,[copy_size]
-
 
543
	call	editor_realloc_lines
-
 
544
 
-
 
545
	mov	eax,[cur_editor.Lines]
-
 
546
	mov	ebx,[cur_editor.Lines.Size]
-
 
547
	add	ebx,[copy_size]
-
 
548
	mov	[cur_editor.Lines.Size],ebx
-
 
549
	call	mem.ReAlloc
538
	call	delete_selection
550
	mov	[cur_editor.Lines],eax
539
 
551
 
540
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
552
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
541
	call	get_line_offset
553
	call	get_line_offset
542
	pushd	[esi] esi
554
	pushd	[esi] esi
-
 
555
	mov	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
-
 
556
	call	line_add_spaces
543
	mov	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
557
	add	[esp],eax		 ;!!!
544
	call	line_add_spaces
558
	add	esi,eax 		 ;!!!
545
	mov	ecx,[copy_size]
559
	mov	ecx,[copy_size]
546
	sub	ecx,4
560
	sub	ecx,4
547
	mov	edi,[cur_editor.Lines] ;! AREA_TEMP2
561
	mov	edi,[cur_editor.Lines] ;! AREA_TEMP2
Line 568... Line 582...
568
	lodsd
582
	lodsd
Line 569... Line 583...
569
 
583
 
570
	mov	ebx,[cur_editor.Caret.X] ;! ebx,[pos.x]
584
	mov	ebx,[cur_editor.Caret.X] ;! ebx,[pos.x]
571
	add	eax,ebx
585
	add	eax,ebx
-
 
586
	mov	[edi-4],ax
572
	mov	[edi-4],ax
587
	mov	byte[edi-4+2],0x0001
573
	sub	eax,ebx
588
	sub	eax,ebx
574
	call	.check_columns
589
	call	.check_columns
575
	add	edi,ebx
590
	add	edi,ebx
576
    @@: push	ecx
591
    @@: push	ecx
577
	mov	ecx,eax
592
	mov	ecx,eax
578
	rep	movsb
593
	rep	movsb
579
	lodsd
594
	lodsd
580
	and	eax,0x0000FFFF
595
	and	eax,0x0000FFFF
581
	stosd
596
	stosd
582
	or	dword[edi-4],0x00010000
597
	mov	byte[edi-4+2],0x0001
583
	pop	ecx
598
	pop	ecx
Line 584... Line 599...
584
	loop	@b
599
	loop	@b
585
 
600
 
Line 654... Line 669...
654
endf
669
endf
Line 655... Line 670...
655
 
670
 
656
;-----------------------------------------------------------------------------
671
;-----------------------------------------------------------------------------
657
func key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
672
func key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
-
 
673
;-----------------------------------------------------------------------------
-
 
674
	mov	eax,94
-
 
675
	call	editor_realloc_lines
658
;-----------------------------------------------------------------------------
676
 
659
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
677
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
660
	call	get_line_offset
678
	call	get_line_offset
Line 661... Line 679...
661
	mov	ebx,esi
679
	mov	ebx,esi
Line 700... Line 718...
700
 
718
 
701
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
719
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
702
	call	get_line_offset
720
	call	get_line_offset
703
	mov	edi,esi
721
	mov	edi,esi
-
 
722
	lodsd
704
	lodsd
723
	and	eax,0x0000FFFF
-
 
724
	add	esi,eax
Line 705... Line 725...
705
	add	esi,eax
725
	push	eax
706
 
726
 
-
 
727
	dec	[cur_editor.Lines.Count] ;! [lines]
-
 
728
	;mov     ecx,[temp_buf] ;! AREA_TEMP2
707
	dec	[cur_editor.Lines.Count] ;! [lines]
729
	mov	ecx,[cur_editor.Lines]
708
	mov	ecx,[temp_buf] ;! AREA_TEMP2
730
	add	ecx,[ecx-4]
709
	sub	ecx,esi
731
	sub	ecx,esi
710
	shr	ecx,2		       ;// fixed (was 4)
732
	shr	ecx,2		       ;// fixed (was 4)
-
 
733
	cld
-
 
734
	rep	movsd
-
 
735
 
-
 
736
	pop	eax
-
 
737
	add	eax,4
-
 
738
	neg	eax
-
 
739
	call	editor_realloc_lines
-
 
740
 
-
 
741
	m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X]
711
	cld
742
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y]
712
	rep	movsd
743
 
Line 713... Line 744...
713
	call	check_inv_all
744
	call	check_inv_all
714
	mov	[cur_editor.Modified],1 ;! [modified],1
745
	mov	[cur_editor.Modified],1 ;! [modified],1
Line 1127... Line 1158...
1127
	dec	eax
1158
	dec	eax
1128
	mov	[cur_editor.Caret.Y],eax ;! [pos.y],eax
1159
	mov	[cur_editor.Caret.Y],eax ;! [pos.y],eax
1129
    @@: m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
1160
    @@: m2m	[cur_editor.SelStart.X],[cur_editor.Caret.X] ;! [sel.x],[pos.x]
1130
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
1161
	m2m	[cur_editor.SelStart.Y],[cur_editor.Caret.Y] ;! [sel.y],[pos.y]
Line -... Line 1162...
-
 
1162
 
-
 
1163
	mov	ecx,[cur_editor.Lines.Count]
-
 
1164
	call	get_line_offset
-
 
1165
	movzx	eax,word[esi]
-
 
1166
	lea	esi,[esi+eax+4]
-
 
1167
	mov	eax,[cur_editor.Lines]
-
 
1168
	add	eax,[eax-4]
-
 
1169
	sub	esi,eax
-
 
1170
	lea	eax,[esi+4096]
-
 
1171
	call	editor_realloc_lines
1131
 
1172
 
1132
	mov	[cur_editor.Modified],1 ;! [modified],1
1173
	mov	[cur_editor.Modified],1 ;! [modified],1
1133
  .exit.2:
1174
  .exit.2:
Line 1134... Line 1175...
1134
	call	check_inv_all
1175
	call	check_inv_all
Line 1221... Line 1262...
1221
	add	eax,ATABW
1262
	add	eax,ATABW
1222
	and	eax,not(ATABW-1)
1263
	and	eax,not(ATABW-1)
1223
	push	eax ' '
1264
	push	eax ' '
1224
	sub	eax,ecx
1265
	sub	eax,ecx
1225
  .direct:
1266
  .direct:
-
 
1267
	push	eax
-
 
1268
	call	editor_realloc_lines
-
 
1269
	pop	eax
1226
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1270
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1227
	call	get_line_offset
1271
	call	get_line_offset
1228
	and	dword[esi],not 0x00020000
1272
	and	dword[esi],not 0x00020000
1229
	or	dword[esi],0x00010000
1273
	or	dword[esi],0x00010000
Line 1236... Line 1280...
1236
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1280
	mov	eax,[cur_editor.Caret.X] ;! eax,[pos.x]
1237
    @@: movzx	edx,word[esi]
1281
    @@: movzx	edx,word[esi]
1238
	sub	edx,eax
1282
	sub	edx,eax
1239
	cmp	ecx,edx
1283
	cmp	ecx,edx
1240
	jl	@f
1284
	jl	@f
-
 
1285
	push	eax
-
 
1286
	mov	eax,10
-
 
1287
	call	editor_realloc_lines
-
 
1288
	add	esi,eax
-
 
1289
	pop	eax
1241
	pushad; esi ecx eax
1290
	pushad; esi ecx eax
1242
	mov	ecx,[cur_editor.Lines] ;! AREA_TEMP2-10+1
1291
	mov	ecx,[cur_editor.Lines] ;! AREA_TEMP2-10+1
1243
	add	ecx,[ecx-4]
1292
	add	ecx,[ecx-4]
1244
	dec	ecx
1293
	dec	ecx
1245
	mov	edi,ecx ;! AREA_TEMP2
1294
	mov	edi,ecx ;! AREA_TEMP2
1246
	add	ecx,-10+1
1295
	add	ecx,-10+1
1247
;       lea     eax,[esi+4]
1296
;       lea     eax,[esi+4]
1248
;       add     eax,[esi]
1297
;       add     eax,[esi]
1249
	movzx	eax,word[esi]
1298
	movzx	eax,word[esi]
1250
	lea	eax,word[esi+eax+4]
1299
	lea	eax,[esi+eax+4]
1251
	sub	ecx,eax
1300
	sub	ecx,eax
1252
	lea	esi,[edi-10] ;! AREA_TEMP2-10
1301
	lea	esi,[edi-10] ;! AREA_TEMP2-10
1253
	std
1302
	std
1254
	rep	movsb
1303
	rep	movsb
1255
	mov	ecx,10
1304
	mov	ecx,10
Line 1296... Line 1345...
1296
;-----------------------------------------------------------------------------
1345
;-----------------------------------------------------------------------------
1297
func key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
1346
func key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
1298
;-----------------------------------------------------------------------------
1347
;-----------------------------------------------------------------------------
1299
	call	delete_selection
1348
	call	delete_selection
Line -... Line 1349...
-
 
1349
 
-
 
1350
	mov	eax,14
-
 
1351
	call	editor_realloc_lines
1300
 
1352
 
1301
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
1353
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
Line 1302... Line 1354...
1302
	call	get_line_offset
1354
	call	get_line_offset
1303
 
1355
 
Line 1487... Line 1539...
1487
	cmp	[tab_bar.Items.Count],0
1539
	cmp	[tab_bar.Items.Count],0
1488
	jne	@f
1540
	jne	@f
1489
	call	create_tab
1541
	call	create_tab
1490
    @@: ret
1542
    @@: ret
1491
endf
1543
endf
-
 
1544
 
-
 
1545
;-----------------------------------------------------------------------------
-
 
1546
func key.shift_f9 ;///// SET DEFAULT TAB /////////////////////////////////////
-
 
1547
;-----------------------------------------------------------------------------
-
 
1548
	mov	eax,[tab_bar.Current.Ptr]
-
 
1549
	cmp	eax,[tab_bar.Default.Ptr]
-
 
1550
	jne	@f
-
 
1551
	xor	eax,eax
-
 
1552
    @@: mov	[tab_bar.Default.Ptr],eax
-
 
1553
	mov	ebp,[tab_bar.Current.Ptr]
-
 
1554
	call	make_tab_visible
-
 
1555
	cmp	[tab_bar.Style],2
-
 
1556
	jbe	@f
-
 
1557
	call	align_editor_in_tab
-
 
1558
	call	draw_editor
-
 
1559
    @@: call	draw_tabctl
-
 
1560
	ret
-
 
1561
endf