#1609 Caret line rendering clipped to scrollWidth


The default scrollWidth for a scintilla document is 2000. If SCI_SETCARETLINEVISIBLE is enabled and the scintilla view is larger than the scrollWidth, the caret line is clipped to the scrollWidth instead of using the whole width of the view.

1 Attachments


  • Neil Hodgson

    Neil Hodgson - 2014-06-05

    There are other aspects of drawing like eolfilled backgrounds that also stop at the scroll width.

    Unsure this should be classified as a bug. Does changing this mean that the document has logically unlimited width? Or does it just extend some drawing outside the document. Will there have to be similar changes at the bottom of the document, such as extending the final background colour?

  • chinhster

    chinhster - 2014-06-05

    I didn't see this behavior in Notepad++ for Windows so I just assumed this was a bug in the Cocoa version of Scintilla.

    My only other experience with this feature is TextWrangler for the Mac which fills the background from edge to edge.

  • Neil Hodgson

    Neil Hodgson - 2014-06-06

    It may be worthwhile experimenting with this to see if it can easily be made to work as you want. I'm just a little cautious.

    In your application, you might want to set scroll width to the current screen width when larger than 2000 as that should avoid the white area except when responsive scrolling goes beyond the end then bounces back. If this works well then it could become a default set by ScintillaView.

    • Jason Frost

      Jason Frost - 2015-11-17

      Hi Neil. (Thank you for your years of work!)
      I encountered this "white area" while porting a Windows program to OS X.

      Personally I don't mind the caret line highlight ending at the scrollWidth.
      My bigger concern is: when the editor background is anything besides white (ie. any dark theme) then a large white area looks like a drawing glitch. (For a few reasons, I would prefer not to just set the scrollWidth to an arbitrarily large value to cover this white area.)

      Is the "white" color which fills the past-scrollWidth area something which the Scintilla could control, maybe in a future version? It doesn't need its own color setting -- could it just fill with the STYLE_DEFAULT back color?

      • Neil Hodgson

        Neil Hodgson - 2015-11-17

        You could look into backgroundColor

        • Jason Frost

          Jason Frost - 2015-11-18

          Thank you for the hint. Would this involve modifying the Scintilla source, or is there an "external" way to get the handle to its NSScrollView? (Sorry, new to Cocoa.)

          • Neil Hodgson

            Neil Hodgson - 2015-11-19

            It should be possible to navigate the view hierarchy and change this from outside.

            A more integrated approach may be to interpret setting the STYLE_DEFAULT background in ScintillaCocoa by changing this property.


Log in to post a comment.