flat assembler
Message board for the users of flat assembler.

Index > IDE Development > [Bug in FASMW]"Vertical selection" resets when...

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
Try it yourself!
File -> New,
Edit -> Vertical selection should be checked
Write in anything meaningless to generate error, press f9 or ctrl+f9, save the file and close the error box. Voila, the setting is gone, you'll have to reset it every time!

Unfortunately there is at least one other way to trigger this bug (even when I can compile without error) but I can't always reproduce that. I will edit this post when I find that other case too. Tomasz, maybe you should check the code because this Vertical selection reset must have to do something with the compiler module.
Post 25 Aug 2011, 02:00
View user's profile Send private message Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
By the way, can anyone explain to me(I don't wanna make a new thread for this)
:
In the options menu, what does compiler memory do? What value size should I put there?
What does revive dead keys do? Thanks!
Post 25 Aug 2011, 02:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
You will notice in the source code FASMW.ASM it has this:
Code:
;skip 2467 lines
      show_ok:
      invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0
       invoke  SendMessage,[hwnd_asmedit],AEM_GETMODE,0,0
  and     eax,not AEMODE_VERTICALSEL ;<---- See here
       invoke  SendMessage,[hwnd_asmedit],AEM_SETMODE,eax,0
;...    
So the mode is being turned off to display the error line. Try removing the line, reassemble and then see what effect it has when the vertical mode is not disabled.
Post 25 Aug 2011, 02:46
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
rohagymeg wrote:
In the options menu, what does compiler memory do?
It does what you would think it does. It allocates some memory for the compiler when you compile. If you set it too low then you get an error saying the compiler was out of memory and could not compile your file.
rohagymeg wrote:
What does revive dead keys do?
You can search the forum for this. There are already some discussions about this.
Post 25 Aug 2011, 02:50
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

with or without this line
Code:
and     eax,not AEMODE_VERTICALSEL    
I see no difference
(i don't understand, what is the goal of this line)

that said, maybe this solution: (it works)
Code:
show_ok:
  invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0
       invoke  SendMessage,[hwnd_asmedit],AEM_GETMODE,0,0

      push eax ;<-- +

      and     eax,not AEMODE_VERTICALSEL
  invoke  SendMessage,[hwnd_asmedit],AEM_SETMODE,eax,0
        mov     eax,[aepos.selectionLine]
   xchg    eax,[aepos.caretLine]
       mov     [aepos.selectionLine],eax
   mov     eax,[aepos.selectionPosition]
       xchg    eax,[aepos.caretPosition]
   mov     [aepos.selectionPosition],eax
       invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0

   pop eax ;<-- +
   invoke  SendMessage,[hwnd_asmedit],AEM_SETMODE,eax,0 ;<-- +

  xor     eax,eax
     ret
show_failed:
     or      eax,-1
      ret
    


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 25 Aug 2011, 08:04
View user's profile Send private message Send e-mail Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
revolution wrote:
You will notice in the source code FASMW.ASM it has this:
Code:
;skip 2467 lines
      show_ok:
       invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0
       invoke  SendMessage,[hwnd_asmedit],AEM_GETMODE,0,0
  and     eax,not AEMODE_VERTICALSEL ;<---- See here
       invoke  SendMessage,[hwnd_asmedit],AEM_SETMODE,eax,0
;...    
So the mode is being turned off to display the error line. Try removing the line, reassemble and then see what effect it has when the vertical mode is not disabled.


Then the other occurrance might be when I just press ctrl+F9 and the compiler shows a completed message. It has to be tweaked there too. But I don't want to hack this because I think this is a bug and should be fixed in the official release. I'm curious about what Tomasz can say about this.
Post 25 Aug 2011, 14:05
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
revolution already explained it - when a compilation error occurs, fasmw sets the selection to line that caused the error. To select line the horizontal selection mode is needed, so it is switched on for that purpose.
Post 25 Aug 2011, 14:27
View user's profile Send private message Visit poster's website Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
Alright, got it! push eax, pop eax, makes perfect sense! It saves the state(if it was on or off before changing it to off) and restores that state after the compiler displayed the message. I guess you'll fix this, but you didn't mention(maybe because it's common sense).
Post 25 Aug 2011, 14:50
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
The point of this feature is to make the erroneous line selected, and it works like it was intended. If it was to be for the time of displaying error summary only, then not only selection mode, but also selection position (including caret) would have to be restored, and this would not be behavior I wanted.
Post 25 Aug 2011, 15:03
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

i tried both cases.
with and without "and eax,not AEMODE_VERTICALSEL"
(in both cases with vertical selection : on)
i see no difference in behavior.
in both cases, fasmw correctly selects the line that caused the error.
(Can anyone confirm this?)

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 25 Aug 2011, 15:18
View user's profile Send private message Send e-mail Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
EDIT: Okay, now I get it(it took a while)! It selects the line with the first error. Okay, this is a good explanation.
ouadji, it doesn't select the actual line in the IDE (after error message)when I use your code. So that's what these clever guys were talking about. They have much more experience than us Very Happy
Post 26 Aug 2011, 00:01
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Vertical selection also tends to be about personal taste. I like it very much, but I sometimes forget that its on and when I copy some text from other editors, I feel like the clipboard is empty, while actually I just need to Alt+Ins Ctrl+V.

I would even welcome a feature where vertical select had a timeout equal to my short memory span Very Happy
Post 26 Aug 2011, 06:50
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

sorry, I have still tried several times, but I see no difference in behavior. Confused
(with or without "and eax,not AEMODE_VERTICALSEL" and vertical selection ON).
In all cases, fasmw correctly selects the line that caused the error.
I don't understand, really! Does anyone have an example of .asm file to download with which I can see this difference?
Thank you.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 26 Aug 2011, 08:09
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
ouadji wrote:
Does anyone have an example of .asm file to download with which I can see this difference?
I haven't tried it so see but perhaps when you have multiple error lines displayed?
Code:
macro ERROR {error}
ERROR    
Post 26 Aug 2011, 08:48
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji


with or without, no difference.
In both cases, before compiling, the vertical selection is on.
(I hope you can see the picture below)

Code:
;CODE A (original code) == "with"
;------
      show_ok:
  invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0
       invoke  SendMessage,[hwnd_asmedit],AEM_GETMODE,0,0
  and     eax,not AEMODE_VERTICALSEL
  invoke  SendMessage,[hwnd_asmedit],AEM_SETMODE,eax,0
        mov     eax,[aepos.selectionLine]
   xchg    eax,[aepos.caretLine]
       mov     [aepos.selectionLine],eax
   mov     eax,[aepos.selectionPosition]
       xchg    eax,[aepos.caretPosition]
   mov     [aepos.selectionPosition],eax
       invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0
       xor     eax,eax
     ret
      show_failed:
       or      eax,-1
      ret
    

Code:
;CODE B == "without"
;------
      show_ok:
   invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0
;      invoke  SendMessage,[hwnd_asmedit],AEM_GETMODE,0,0
; and     eax,not AEMODE_VERTICALSEL
; invoke  SendMessage,[hwnd_asmedit],AEM_SETMODE,eax,0
        mov     eax,[aepos.selectionLine]
   xchg    eax,[aepos.caretLine]
       mov     [aepos.selectionLine],eax
   mov     eax,[aepos.selectionPosition]
       xchg    eax,[aepos.caretPosition]
   mov     [aepos.selectionPosition],eax
       invoke  SendMessage,[hwnd_asmedit],AEM_SETPOS,aepos,0
       xor     eax,eax
     ret
      show_failed:
       or      eax,-1
      ret
    

Image

As you can see, there is no difference in behavior.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 26 Aug 2011, 10:05
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
And what about the situation when you move to different lines from the error box?
Post 26 Aug 2011, 10:31
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

In both cases, no problem and identical behavior. In the error dialog box, If I click on "revolution.asm (2)", line 2 is selected and highlighted ("macro ERROR {error}") ... and if I click on "revolution.asm (3), then the line 3 is selected and highlighted ("ERROR"). This, again, in both cases.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 26 Aug 2011, 11:27
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
ouadji: you hit a special case when the line is the last line in file. Try having an error in some middle line.
Post 26 Aug 2011, 12:16
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

ok Tomasz, I saw the problem, I understood!

I tried a solution (below)
This preserves the state of the selection.

When the summary dialog box is open, no problem.
but, if the selection is in vertical mode before compiling,
then when you close the summary dialog box,
the error line is no longer highlighted ...
because the vertical selection is restored.

That said, for the user who often uses the vertical selection,
it is (very) annoying that this vertical selection is disabled after each compilation with error(s).

Code:
;FASMW.ASM

mem_vs dd ?

proc  SummaryDialog hwnd_dlg,msg,wparam,lparam

        ...
 mov     ebx,FALSE
   cmp     [msg],WM_CLOSE
      je      .close
      ...

.initdialog:
 invoke  SendMessage,[hwnd_asmedit],AEM_GETMODE,0,0
  mov     [mem_vs],eax
        ...

.command:
    cmp     [wparam],ID_LINES + LBN_SELCHANGE shl 16
    je      .show_line

      mov     ebx,TRUE
    cmp     [wparam],IDCANCEL ; => BUTTON "OK"
     jne     .finish

;        cmp     [wparam],IDOK ;useless
;     jne     .finish

.close:
  mov     eax,[mem_vs]
        invoke  SendMessage,[hwnd_asmedit],AEM_SETMODE,eax,0
        invoke  EndDialog,[hwnd_dlg],ebx

.processed:
     mov     eax,1
.finish:
       pop     edi esi ebx
 ret
endp
    

with "Wink" the problem is much less annoying, because the current line is highlighted. when I close the dialog box, the last selected line (the last selected error line) is always highlighted.I could "more" easily add this feature in Wink with less inconvenience.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 26 Aug 2011, 18:19
View user's profile Send private message Send e-mail Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
I agree with ouadji and to add something to the discussion:

For someone who uses this feature often, it needs to be saved in the ini file also. I bet a lot of people work this way, so this is not a stupid request to implement in the official release.
Post 26 Aug 2011, 19:22
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.