flat assembler
Message board for the users of flat assembler.

Index > IDE Development > ASMEDIT.INC (bug + solution)

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 25 Jun 2011, 22:51

with the original ASMEDIT.INC code,
after a "file/save", multi_BACK or multi_DELETE does not change the file "state" (modified/unmodified) ... the file keeps the unmodified state.

1) Put the caret in the middle of a line,
2) "delete" ... ok, the file state is modified
3) save/file ... ok, now the file state is unmodified
don't put back the focus on the line
but the caret is still on the line
4) "delete" again
bug, the file keeps the unmodified state !
(if "EXIT", the last changes are lost)

solution ---> (in fact, like "VK_SPACE" code)

Code:
;ASMEDIT.INC
;-----------
; - A -
;-------

no_selection_to_clear:
        .....
;=== my code A =================================
   mov     [current_operation],VK_BACK
 cmp     [last_operation],VK_BACK
    jne     back_undopoint
      mov     edx,[unmodified_state]
      cmp     edx,[undo_data]
     jne     undo_back_ok
        xor     edx,edx
     mov     [unmodified_state],edx
      jmp     undo_back_ok
back_undopoint:
 call    make_undopoint
undo_back_ok:

;=== original A =================================
;       mov     [current_operation],VK_BACK
;        cmp     [last_operation],VK_BACK
;   je      undo_back_ok
;       call    make_undopoint
;undo_back_ok:
;================================================

; - B -
;-------

delete_char:
;=== my code B ==================================
   mov     [current_operation],VK_DELETE
       cmp     [last_operation],VK_DELETE
  jne     delete_undopoint
    mov     edx,[unmodified_state]
      cmp     edx,[undo_data]
     jne     undo_delete_ok
      xor     edx,edx
     mov     [unmodified_state],edx
      jmp     undo_delete_ok
delete_undopoint:
     call    make_undopoint
undo_delete_ok:

;=== original B =================================
;     mov     [current_operation],VK_DELETE
;      cmp     [last_operation],VK_DELETE
; je      undo_delete_ok
;     call    make_undopoint
;undo_delete_ok:
;================================================
    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 25 Jun 2011, 22:51
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.