Rev 824 | Rev 8589 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 824 | Rev 987 | ||
---|---|---|---|
Line 68... | Line 68... | ||
68 | endp |
68 | endp |
Line 69... | Line 69... | ||
69 | 69 | ||
70 | ;----------------------------------------------------------------------------- |
70 | ;----------------------------------------------------------------------------- |
71 | proc get_real_length ;//////////////////////////////////////////////////////// |
71 | proc get_real_length ;//////////////////////////////////////////////////////// |
72 | ;----------------------------------------------------------------------------- |
72 | ;----------------------------------------------------------------------------- |
73 | movzx eax,word[esi] |
73 | mov eax,[esi+EDITOR_LINE_DATA.Size] |
74 | @@: cmp byte[esi+eax+4-1],' ' |
74 | @@: cmp byte[esi+eax+sizeof.EDITOR_LINE_DATA-1],' ' |
75 | jne @f |
75 | jne @f |
76 | dec eax |
76 | dec eax |
77 | jnz @b |
77 | jnz @b |
78 | @@: ret |
78 | @@: ret |
Line 88... | Line 88... | ||
88 | ;----------------------------------------------------------------------------- |
88 | ;----------------------------------------------------------------------------- |
89 | push eax ecx |
89 | push eax ecx |
90 | mov esi,[cur_editor.Lines] |
90 | mov esi,[cur_editor.Lines] |
91 | @@: dec ecx |
91 | @@: dec ecx |
92 | js .exit |
92 | js .exit |
93 | movzx eax,word[esi] |
93 | mov eax,[esi+EDITOR_LINE_DATA.Size] |
94 | lea esi,[esi+eax+4] |
94 | lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA] |
95 | jmp @b |
95 | jmp @b |
96 | .exit: |
96 | .exit: |
97 | pop ecx eax |
97 | pop ecx eax |
98 | ret |
98 | ret |
99 | endp |
99 | endp |
Line 356... | Line 356... | ||
356 | ; Output: |
356 | ; Output: |
357 | ; EAX = delta |
357 | ; EAX = delta |
358 | ;----------------------------------------------------------------------------- |
358 | ;----------------------------------------------------------------------------- |
359 | xor eax,eax |
359 | xor eax,eax |
360 | pushad |
360 | pushad |
361 | movzx edx,word[esi] |
361 | mov edx,[esi+EDITOR_LINE_DATA.Size] |
362 | cmp ecx,edx |
362 | cmp ecx,edx |
363 | jbe .exit |
363 | jbe .exit |
364 | sub ecx,edx |
364 | sub ecx,edx |
365 | lea eax,[ecx+4] |
365 | lea eax,[ecx+sizeof.EDITOR_LINE_DATA] |
366 | call editor_realloc_lines |
366 | call editor_realloc_lines |
367 | mov [esp+4*7],eax |
367 | mov [esp+4*7],eax |
368 | add esi,eax |
368 | add esi,eax |
369 | push ecx |
369 | push ecx |
370 | mov edi,[cur_editor.Lines] |
370 | mov edi,[cur_editor.Lines] |
371 | add edi,[edi-4] |
371 | add edi,[cur_editor.Lines.Size] ; !!! CHECK THIS!!! add edi,[edi-4] |
372 | dec edi |
372 | dec edi |
373 | mov eax,esi |
373 | mov eax,esi |
374 | mov esi,edi |
374 | mov esi,edi |
375 | sub esi,ecx |
375 | sub esi,ecx |
376 | lea ecx,[eax+4] |
376 | lea ecx,[eax+sizeof.EDITOR_LINE_DATA] |
377 | add ecx,edx |
377 | add ecx,edx |
378 | push ecx |
378 | push ecx |
379 | neg ecx |
379 | neg ecx |
380 | lea ecx,[esi+ecx+1] |
380 | lea ecx,[esi+ecx+1] |
381 | std |
381 | std |
382 | rep movsb |
382 | rep movsb |
383 | pop edi ecx |
383 | pop edi ecx |
384 | add [eax],cx |
384 | add [eax+EDITOR_LINE_DATA.Size],ecx |
385 | mov al,' ' |
385 | mov al,' ' |
386 | cld |
386 | cld |
387 | rep stosb |
387 | rep stosb |
388 | .exit: |
388 | .exit: |
389 | popad |
389 | popad |
Line 401... | Line 401... | ||
401 | pushad |
401 | pushad |
402 | mov ecx,[sel.begin.y] |
402 | mov ecx,[sel.begin.y] |
403 | cmp ecx,[sel.end.y] |
403 | cmp ecx,[sel.end.y] |
404 | je .single_line |
404 | je .single_line |
405 | call get_line_offset |
405 | call get_line_offset |
406 | and dword[esi],not 0x00020000 |
406 | and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED |
407 | or dword[esi],0x00010000 |
407 | or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED |
408 | mov ecx,[sel.begin.x] |
408 | mov ecx,[sel.begin.x] |
409 | call line_add_spaces |
409 | call line_add_spaces |
410 | add esi,eax |
410 | add esi,eax |
411 | lea edi,[esi+4] |
411 | lea edi,[esi+sizeof.EDITOR_LINE_DATA] |
412 | mov ecx,[sel.end.y] |
412 | mov ecx,[sel.end.y] |
413 | call get_line_offset |
413 | call get_line_offset |
414 | call get_real_length |
414 | call get_real_length |
415 | cmp eax,[sel.end.x] |
415 | cmp eax,[sel.end.x] |
416 | jbe @f |
416 | jbe @f |
417 | mov eax,[sel.end.x] |
417 | mov eax,[sel.end.x] |
418 | @@: movzx ecx,word[esi] |
418 | @@: mov ecx,[esi+EDITOR_LINE_DATA.Size] |
419 | sub ecx,eax |
419 | sub ecx,eax |
420 | mov ebx,[sel.begin.x] |
420 | mov ebx,[sel.begin.x] |
421 | add ebx,ecx |
421 | add ebx,ecx |
422 | mov [edi-4],bx |
422 | mov [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],ebx |
423 | add edi,[sel.begin.x] |
423 | add edi,[sel.begin.x] |
424 | lea esi,[esi+eax+4] |
424 | lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA] |
425 | mov ecx,[cur_editor.Lines] |
425 | mov ecx,[cur_editor.Lines] |
426 | add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4] |
426 | add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4] |
427 | sub ecx,esi |
427 | sub ecx,esi |
428 | cld |
428 | cld |
429 | rep movsb |
429 | rep movsb |
Line 432... | Line 432... | ||
432 | sub [cur_editor.Lines.Count],eax |
432 | sub [cur_editor.Lines.Count],eax |
433 | jmp .exit |
433 | jmp .exit |
Line 434... | Line 434... | ||
434 | 434 | ||
435 | .single_line: |
435 | .single_line: |
436 | call get_line_offset |
436 | call get_line_offset |
437 | and dword[esi],not 0x00020000 |
437 | and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED |
438 | or dword[esi],0x00010000 |
438 | or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED |
439 | call get_real_length |
439 | call get_real_length |
440 | cmp eax,[sel.begin.x] |
440 | cmp eax,[sel.begin.x] |
441 | jbe .exit |
441 | jbe .exit |
442 | mov ecx,[sel.end.x] |
442 | mov ecx,[sel.end.x] |
443 | cmp ecx,eax |
443 | cmp ecx,eax |
444 | jbe @f |
444 | jbe @f |
445 | mov ecx,eax |
445 | mov ecx,eax |
446 | @@: sub ecx,[sel.begin.x] |
446 | @@: sub ecx,[sel.begin.x] |
447 | sub [esi],cx |
447 | sub [esi+EDITOR_LINE_DATA.Size],ecx |
448 | lea edi,[esi+4] |
448 | lea edi,[esi+sizeof.EDITOR_LINE_DATA] |
449 | add edi,[sel.begin.x] |
449 | add edi,[sel.begin.x] |
450 | lea esi,[edi+ecx] |
450 | lea esi,[edi+ecx] |
451 | mov ecx,[cur_editor.Lines] |
451 | mov ecx,[cur_editor.Lines] |
452 | add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4] |
452 | add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4] |
Line 462... | Line 462... | ||
462 | mov [cur_editor.Caret.Y],eax |
462 | mov [cur_editor.Caret.Y],eax |
463 | mov [cur_editor.SelStart.Y],eax |
463 | mov [cur_editor.SelStart.Y],eax |
Line 464... | Line 464... | ||
464 | 464 | ||
465 | mov ecx,[cur_editor.Lines.Count] |
465 | mov ecx,[cur_editor.Lines.Count] |
466 | call get_line_offset |
466 | call get_line_offset |
467 | movzx eax,word[esi] |
467 | mov eax,[esi+EDITOR_LINE_DATA.Size] |
468 | lea esi,[esi+eax+4] |
468 | lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA] |
469 | mov eax,[cur_editor.Lines] |
469 | mov eax,[cur_editor.Lines] |
470 | add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4] |
470 | add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4] |
471 | sub esi,eax |
471 | sub esi,eax |
472 | lea eax,[esi+4096] |
472 | lea eax,[esi+4096] |