Menu

#1217 Block cursor for the override mode.

Committed
closed
nobody
4
2019-06-02
2018-05-01
SalviaSage
No

Hi there. I am a notepad++ user.

In that program, we have block cursors that highlight the character the cursor is on. However, this cursor is only available for the insert mode, it is not there for the override mode which is really where it should be, and apparently can not be there because the override cursor is implemented from Scintilla and can't be changed.

Thus I would like to ask that the users are given the choice of using block caret highlighting cursors in the override mode here in scintilla. from here, it can be then easily introduced into notepad++ or other areas.

Or, if you know a way around this for displaying the block cursor for the override mode, please tell.

Thanks for considering my suggestion!

-SalviaSage

Related

Bugs: #2106

Discussion

1 2 > >> (Page 1 of 2)
  • Neil Hodgson

    Neil Hodgson - 2018-05-01
    • labels: cursor --> cursor, scintilla
    • Priority: 5 --> 4
     
  • Neil Hodgson

    Neil Hodgson - 2018-05-01

    This seems like a reasonable feature if anyone is interested in implementing it.

     
  • SalviaSage

    SalviaSage - 2018-05-02

    Thanks for agreeing with me!

    I am willing to do the testing for this implementation.
    However, I can not code it.

    If anyone is volunteering to work on this, please get in touch with me, thanks!

     
  • Neil Hodgson

    Neil Hodgson - 2018-05-14
    • Group: Committed --> Completed
     
  • Zufu Liu

    Zufu Liu - 2018-09-02

    Is SetCaretStyle(CARETSTYLE_BLOCK) not do this?

     
  • SalviaSage

    SalviaSage - 2019-01-26

    Hi.

    You moved this ticket to Committed --> Completed earlier.

    However, it looks like the feature is still not in, or if it is in I do not know how to set it as such.

    Can anyone help me with this?
    Basically, we want the caret to be on top of the whole letter on the override mode instead of only being a small line under the letter.

     
    • Neil Hodgson

      Neil Hodgson - 2019-01-26

      There are a limited set of 'milestone's available for a feature request. 'Completed' is the initial default. It is changed to 'Committed' when code implementing the feature has been added to the Scintilla repository. No change has been committed so I reset the milestone to its default.

       
  • Zufu Liu

    Zufu Liu - 2019-01-27

    That's my fail.

    I added the changes here. The block caret can be set by
    SetCaretStyle(CARETSTYLE_BLOCK, true)
    or SendMessage(hwnd, SCI_SETCARETSTYLE, CARETSTYLE_BLOCK, TRUE)
    or execute(SCI_SETCARETSTYLE, CARETSTYLE_BLOCK, true)

    maybe it's better to add new getter and setter.

     

    Last edit: Zufu Liu 2019-01-27
    • Neil Hodgson

      Neil Hodgson - 2019-01-30

      That doesn't appear to be a sensible API to me as it has changed the meaning from a simple property to a conditional property.

      Here are 2 better APIs:

      # Using one extra enumeration. Simpler if there are unlikely to be more changes.
      val CARETSTYLE_BLOCK_ALWAYS=3
      Show block caret in all modes.

      # Using separate fields of bits for normal and overstrike modes. Better if there may be additional choices for overstrike mode.
      val CARETSTYLE_OVERSTRIKE_BAR=0
      val CARETSTYLE_OVERSTRIKE_BLOCK=16

      drawOverstrikeCaret should not be removed from EditView as it is needed by the curses platform.

       
      • SalviaSage

        SalviaSage - 2019-01-30

        Good find. I am eagerly waiting for the implementation of this feature. <3

         
      • Zufu Liu

        Zufu Liu - 2019-01-30

        Patch for CARETSTYLE_BLOCK_ALWAYS.

         
        • Neil Hodgson

          Neil Hodgson - 2019-01-31

          Should include change to documentation.

           
  • SalviaSage

    SalviaSage - 2019-01-27

    Thanks Zufu. Hopefully, it will be implemented soon.
    And, can it be used in the INS mode also? (overwriting the letters)

     
    • Zufu Liu

      Zufu Liu - 2019-01-27

      This patch added a new caret settings for OVR mode, not affect INS mode.

      Once committed, it requires Notepad++ to expose the new settings in Preferences -> Editing -> Caret Settings.

       
  • Zufu Liu

    Zufu Liu - 2019-01-27

    There is a logical error in the patch which may always draw a block caret in OVR mode.

    } else if ((vsDraw.caretStyle == CARETSTYLE_BLOCK) || imeCaretBlockOverride
        || (model.inOverstrike && vsDraw.overstrikeCaret == CARETSTYLE_BLOCK)) {
    

    need change to

    } else if ((!model.inOverstrike && ((vsDraw.caretStyle == CARETSTYLE_BLOCK) || imeCaretBlockOverride))
        || (model.inOverstrike && vsDraw.overstrikeCaret == CARETSTYLE_BLOCK)) {
    

    or (always drawing block caret if imeCaretBlockOverride is set (for Korean IME))

    } else if ((!model.inOverstrike && vsDraw.caretStyle == CARETSTYLE_BLOCK) || imeCaretBlockOverride
        || (model.inOverstrike && vsDraw.overstrikeCaret == CARETSTYLE_BLOCK)) {
    
     
  • Zufu Liu

    Zufu Liu - 2019-02-01

    Updated, my update to the document may not precise.

     
  • Neil Hodgson

    Neil Hodgson - 2019-02-02
    • Group: Completed --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2019-02-02

    Committed as [aba09a].

     

    Related

    Commit: [aba09a]

  • SalviaSage

    SalviaSage - 2019-02-02

    Hi.

    Thanks for committing a ticket that I opened.

    Now, How do I try this change from this end here?

    thanks.

     
    • Zufu Liu

      Zufu Liu - 2019-02-02

      For Notepad++, personally I think what you can do is just continue wait on https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4467
      For Notepad2, you can try v4.19.02r1808 (View -> Caret Style) from https://github.com/zufuliu/notepad2/releases
      I don't know how to configure SciTE (need build from latest source) and other Scintilla based editors (most of them use tagged release of Scintilla).

       

      Last edit: Zufu Liu 2019-02-02
  • SalviaSage

    SalviaSage - 2019-02-02
     

    Last edit: SalviaSage 2019-02-02
  • SalviaSage

    SalviaSage - 2019-02-02

    Hi Zufu Liu.

    I just tried your notepad2, and the block caret mode can now be enabled in your Notepad2 editor for either both modes, or the INS mode.

    But I noticed that it can not be enabled for the OVR mode, which is of course, the only mode I am interested in. Block caret for the OVR mode.

    So, is it the same also in SciTE now? If so, can you make sure that the option for OVR is in?
    And how do I test this in SciTE? Have you tested it? I know we can't test it until it is rebuild, so perhaps you can send me a copy of it so I can try here or give instructions on building SciTE from scratch.

    I am not a good programmer, but I can follow instructions on how to build it etc. I really want to see this change. And, contact me with PM if interested in chat.

    thx, see you.

     
  • Zufu Liu

    Zufu Liu - 2019-02-03

    This will need revert the commit and implement the second.

    # Using separate fields of bits for normal and overstrike modes. Better if there may be additional choices for overstrike mode.
    val CARETSTYLE_OVERSTRIKE_BAR=0
    val CARETSTYLE_OVERSTRIKE_BLOCK=16

    I found testing and validating caret style is hard with bit fields than with separate caret style for INS mode and OVR mode (first incomplete patch, https://sourceforge.net/p/scintilla/feature-requests/1217/#b799).

     

    Last edit: Zufu Liu 2019-02-03
  • SalviaSage

    SalviaSage - 2019-02-03

    Okay, so... still no block carets for the OVR mode. :'(

     
  • Zufu Liu

    Zufu Liu - 2019-02-03

    Patch for the second.

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.