Fresh IDE . Check-in [cbb223a6c7]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed bug in AsmEdit component. The bug damaged the colors on screen sizes higher than the maximal line size (aeLineCharLen).
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:cbb223a6c736c8f66fd325fdf2e6946443a2ef26
User & Date: johnfound 2018-02-06 13:44:23
Context
2018-06-11
15:54
Minor change in asmedit.asm check-in: 5f458c42ba user: johnfound tags: trunk
2018-02-06
13:44
Fixed bug in AsmEdit component. The bug damaged the colors on screen sizes higher than the maximal line size (aeLineCharLen). check-in: cbb223a6c7 user: johnfound tags: trunk
2017-12-30
10:11
The official release v2.6.2

Updated the documentation. Updated the FASM compiler. Minor edits to the help CSS styles and the help index. check-in: 1863b5fab7 user: johnfound tags: trunk, v2.6.2

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to include/libs/asmedit/asmedit.asm.

98
99
100
101
102
103
104

105
106
107
108
109
110
111
...
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
...
661
662
663
664
665
666
667

668
669
670
671
672
673
674
....
3525
3526
3527
3528
3529
3530
3531




3532
3533
3534
3535
3536
3537
3538
....
3812
3813
3814
3815
3816
3817
3818

3819
3820
3821
3822
3823
3824
3825
3826


3827


3828

3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
  .editor_status_size = $ - .editor_data

  .editor_font dd ?
  .font_width dd ?
  .font_height dd ?
  .page_size dd ?
  .editor_screen dd ?

  .screen_width_bytes dd ?
  .screen_width dd ?
  .screen_height dd ?
  .background_color dd ?
  .text_color dd ?
  .selection_background dd ?
  .selection_text dd ?
................................................................................

.brush_ok:
        lea     eax, [.rect]
        invoke  FillRect, ebx, eax, ecx
        jmp     .paint_next_block

    .get_empty_selection:

        cmp     edx, ecx
        je      .fill_empty_selection

        cmp     word [esi + aeCharSize * edx], 0
        jne     .fill_empty_selection

        test    word [edi + aeCharSize * edx], 80h
................................................................................
        add     [.rect.top],eax
        add     [.rect.bottom],eax
        pop     ecx
        dec     ecx
        jnz     .paint_screen

.end_paint_free:

        invoke  DeleteObject,[.background_brush]
        invoke  DeleteObject,[.selection_brush]
        invoke  DeleteObject,[.focus_brush]

.end_paint:
        lea     eax, [.ps]
        invoke  EndPaint,[.hwnd],eax
................................................................................
    .margin_ok:
        mov     eax,[.rect.right]
        sub     eax,[.rect.left]
        cdq
        div     [.font_width]
        add     edx, -1
        adc     eax, 0




        mov     [.screen_width], eax

if aeCharSize > 1
        lea     eax, [aeCharSize*eax]
end if
        mov     [.screen_width_bytes], eax

................................................................................

        lea     eax, [esi + AELINE.text]
        lea     edi, [.line_colors]

        invoke  .syntax_proc, eax, edi          ; syntax proc

        mov     edx, [.window_position]

        lea     esi, [esi + AELINE.text + aeCharSize*edx]
        mov     eax, aeLineCharLen
        sub     eax, edx

        cmp     eax, [.screen_width]
        jbe     .prepare_line

        mov     eax, [.screen_width]





.prepare_line:

        mov     ecx, eax
        push    eax

        mov     ax, $20
        lea     edi, [esi+aeCharSize*ecx-aeCharSize]

        std
        repe scasw      ; search for the first non-space char.
        cld

        je      .end_of_line            ; empty line found

        add     ecx, 1

        mov     edi, [esp+4]      ; saved EDI
        rep movsw                 ; copy non-empty line.

.end_of_line:
        pop     eax

        lea     esi, [.line_colors + aeCharSize * edx]
        mov     ecx, eax
        mov     edi, ebx
        rep movsw
        mov     ebx, edi        ; next colors line

        pop     edi
        add     edi, [.screen_width_bytes]

        pop     esi

.prepare_next_line:
        pop     ecx

        mov     esi, [esi+AELINE.next]







>







 







<







 







>







 







>
>
>
>







 







>








>
>

>
>

>












|











|


|







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
...
554
555
556
557
558
559
560

561
562
563
564
565
566
567
...
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
....
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
....
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
  .editor_status_size = $ - .editor_data

  .editor_font dd ?
  .font_width dd ?
  .font_height dd ?
  .page_size dd ?
  .editor_screen dd ?
  .screen_width_abs   dd ?
  .screen_width_bytes dd ?
  .screen_width dd ?
  .screen_height dd ?
  .background_color dd ?
  .text_color dd ?
  .selection_background dd ?
  .selection_text dd ?
................................................................................

.brush_ok:
        lea     eax, [.rect]
        invoke  FillRect, ebx, eax, ecx
        jmp     .paint_next_block

    .get_empty_selection:

        cmp     edx, ecx
        je      .fill_empty_selection

        cmp     word [esi + aeCharSize * edx], 0
        jne     .fill_empty_selection

        test    word [edi + aeCharSize * edx], 80h
................................................................................
        add     [.rect.top],eax
        add     [.rect.bottom],eax
        pop     ecx
        dec     ecx
        jnz     .paint_screen

.end_paint_free:

        invoke  DeleteObject,[.background_brush]
        invoke  DeleteObject,[.selection_brush]
        invoke  DeleteObject,[.focus_brush]

.end_paint:
        lea     eax, [.ps]
        invoke  EndPaint,[.hwnd],eax
................................................................................
    .margin_ok:
        mov     eax,[.rect.right]
        sub     eax,[.rect.left]
        cdq
        div     [.font_width]
        add     edx, -1
        adc     eax, 0

;        mov     edx, aeLineCharLen
;        cmp     eax, edx
;        cmova   eax, edx
        mov     [.screen_width], eax

if aeCharSize > 1
        lea     eax, [aeCharSize*eax]
end if
        mov     [.screen_width_bytes], eax

................................................................................

        lea     eax, [esi + AELINE.text]
        lea     edi, [.line_colors]

        invoke  .syntax_proc, eax, edi          ; syntax proc

        mov     edx, [.window_position]

        lea     esi, [esi + AELINE.text + aeCharSize*edx]
        mov     eax, aeLineCharLen
        sub     eax, edx

        cmp     eax, [.screen_width]
        jbe     .prepare_line

        mov     eax, [.screen_width]
        cmp     eax, aeLineCharLen
        jbe     .prepare_line

        mov     eax, aeLineCharLen

.prepare_line:

        mov     ecx, eax
        push    eax

        mov     ax, $20
        lea     edi, [esi+aeCharSize*ecx-aeCharSize]

        std
        repe scasw      ; search for the first non-space char.
        cld

        je      .end_of_line            ; empty line found

        inc     ecx

        mov     edi, [esp+4]      ; saved EDI
        rep movsw                 ; copy non-empty line.

.end_of_line:
        pop     eax

        lea     esi, [.line_colors + aeCharSize * edx]
        mov     ecx, eax
        mov     edi, ebx
        rep movsw
        add     ebx, [.screen_width_bytes]      ; the next colors line

        pop     edi
        add     edi, [.screen_width_bytes]      ; the next text line

        pop     esi

.prepare_next_line:
        pop     ecx

        mov     esi, [esi+AELINE.next]