段落重排是指:指定左边界(left margin)和右边界(right margin),所有文本都从左边界开始,到右边界结束(换行),超出的插入换行符(折行),不足的删除换行符补足,在此基础上,还可以指定对齐方式(左对齐、右对齐、居中、填充),以及悬挂缩进(hanging indent)值,也就是从第二行开始的左边界,从而实现更为精细的段落格式控制。
在Ultraedit中,要做段落重排,首先要在【格式->段落格式化->段落设置/格式化】对话框中设定前述参数,然后选中要重排的文本,用【格式->段落格式重排】就可以实现重排。下面是实例演示(使用等宽字体才能保证右对齐的效果):
原始文本:
The idea of supersymmetry was the key to the
creation of
supergravity, but the concept had actually originated years earlier with theorists
重排后:
左边界0,右边界40:
The idea of supersymmetry was the key to
the creation of supergravity, but the
concept had actually originated years
earlier with theorists
左边界4,右边界45:
The idea of supersymmetry was the key to
the creation of supergravity, but the
concept had actually originated years
earlier with theorists
左边界4,右边界45,悬挂缩进2:
The idea of supersymmetry was the key to
the creation of supergravity, but the
concept had actually originated years
earlier with theorists
左边界0,右边界45,右对齐:
The idea of supersymmetry was the key to the
creation of supergravity, but the concept had
actually originated years earlier with
theorists
Notepad++的 TextFX插件也有重排功能(TestFX->TextFX Edit->ReWrap),但只能指定右边界,重排功能与UE相比偏弱。