Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Word wrap in NPP for Chinese characters

2. Help
Richard
2011-03-30
2013-09-19
  • Richard
    Richard
    2011-03-30

    Hi all,

    It seems that NPP treats all Chinese characters as a single word, even if it is a sentence. When Chinese and English are edited in the same file, unexpected wraps occur and make the text right ragged. Sometimes the ragged space is so big when the following Chinese sentence is long and taken by NPP as a single word.

    Does any one how can I make NPP to ragged Chinese and English correctly at the same time?

    Thanks.

    Richard

     
  • ollydbg
    ollydbg
    2013-09-18

    Same issue happens here in the latest version of NPP, can the author fix this? Thanks.

     
  • ollydbg
    ollydbg
    2013-09-18

    For your information, the Scintilla component have some wrap mode, see the document:
    http://www.scintilla.org/ScintillaDoc.html#LineWrapping

    SCI_SETWRAPMODE(int wrapMode)
    SCI_GETWRAPMODE
    Set wrapMode to SC_WRAP_WORD (1) to enable wrapping on word boundaries, SC_WRAP_CHAR (2) to enable wrapping between any characters, and to SC_WRAP_NONE (0) to disable line wrapping. SC_WRAP_CHAR is preferred to SC_WRAP_WORD for Asian languages where there is no white space between words.

    So, is it possible to enable wrap char mode? I think this can solve(workaround) the issue, thanks.

     
  • dail8859
    dail8859
    2013-09-19

    Hi,
    As far as I know, you cannot enable SC_WRAP_CHAR through the N++ user interface. However, it is possible to set this option via the NppExec plugin.

    1. Install NppExec (through the Plugin Manager is easiest)
    2. In the menu go to, Plugins->NppExec->Execute...
    3. Paste this text

      sci_sendmsg SCI_SETWRAPMODE SC_WRAP_CHAR
      npp_console 0

    4. Click save and give it a name
    5. Go to Plugins->NppExec->Advanced Options...
    6. In the top right you can select a script to run at startup, select the script you just saved

    This should set this option each time you start up N++