Scintilla not resizing correctly 6.10 LTS

Post bugreports for the Mac OSX version here
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

Scintilla not resizing correctly 6.10 LTS

Post by pjsmith67 »

When you resize a scintilla control with a long line of text and scroll the cursor from the beginning of the line to the end, the cursor disappears where the scintilla control's right border was before it was resized.

This might apply to other platforms as well, but I am only using MacOS 13.6.6

Is this a Scintilla bug or a PB bug?

To demonstrate, use the follow program, resize the window and try moving the cursor from beginning to end with the cursor keys. You may have to do it a couple of times before it starts doing it.

Code: Select all

Procedure mainLoop()
    Define event
    Define done=#False
    Define mnu
    Define gadget
    
    While Not done
      event=WaitWindowEvent() 
      Select event
        Case #PB_Event_Timer
        Case #PB_Event_Gadget
          gadget=EventGadget()
          Select gadget
            ;
          EndSelect
        Case #PB_Event_CloseWindow
          done=#True
        Case #PB_Event_Menu
          mnu=EventMenu()
          Select mnu
            Case #PB_Menu_Quit
              done=#True
          EndSelect
      EndSelect
    Wend
  EndProcedure
  
  Procedure callBack(Gadget, *scinotify.SCNotification)
  EndProcedure
  
  Procedure.i Sci_SendStr(Gadget.i, Message.i, Param.i, lParam.s)
    Protected lBuffer.s = Space(3*Len(lParam))
    PokeS(@lBuffer, lParam, -1, #PB_UTF8)
    ProcedureReturn (ScintillaSendMessage(Gadget, Message, Param, @lBuffer))
  EndProcedure

  Procedure handleResize()
    Debug "resize"
    Define w=WindowWidth(0)
    Define h=WindowHeight(0)
    
    ResizeGadget(1,0,0,w,h)
  EndProcedure
  
  OpenWindow(0,10,10,300,400,"BOO",#PB_Window_SizeGadget)
  ScintillaGadget(1,0,0,300,400,@callback())
  Sci_SendStr(1, #SCI_SETTEXT, #Null, "asdfasdf asdfasdf jlkjlk jl asdfasdf lkasdjfl23riouweoriuwoeri qwerqweroiquweroqwieru")
  BindEvent(#PB_Event_SizeWindow,@handleResize(),0)
  mainloop()
  
Fred
Administrator
Administrator
Posts: 18207
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Scintilla not resizing correctly 6.10 LTS

Post by Fred »

I can see it happening here as well. It looks like a scintilla issue to me, as we don't do anything fancy with the component when creating it. I tried with 5.5.10 version but it's the same.
May be this patch has been ported to cocoa: https://community.notepad-plus-plus.org ... g-starts/4
Post Reply