转Notepad-中文自动换行问题解决方案

31次阅读

共计 887 个字符,预计需要花费 3 分钟才能阅读完成。

Notepad++ 默认对中文换行支持不大好,中英文混排时尤为明显,搜到解决方案一则。

https://sourceforge.net/p/not…

Q: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

A: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

  1. Click save and give it a name Go to Plugins->NppExec->Advanced Options…
  2. 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++

正文完
 0