2008-09-06から1日間の記事一覧

選択範囲の数字をゼロ詰めして桁を合わせるサクラエディタのマクロ

本日3つ目。 padzero.js (function(){ String.prototype.repeat = function(count){ var result = ''; for(var i = 0; i < count; i++){ result += this; } return result; }; String.prototype.padLeft = function(length, char){ return char.repeat(lengt…

行を逆順にするサクラエディタのマクロ

本日2つ目。 reverse.js (function(){ if(Editor.IsTextSelected() == 0) Editor.SelectAll(); var lines = Editor.GetSelectedString(0).split(/\r\n|\r|\n/); var n = ['\r\n', '\r', '\n'][Editor.GetLineCode()]; Editor.InsText(lines.reverse().join(n…

連番を簡単に作るサクラエディタのマクロ

ちょっと欲しくなったので作った。たいしたやつじゃないよ。 autofill.js (function(){ String.prototype.chomp = function(){ return this.replace(/[\r\n]+$/, ''); }; function get_upline(){ Editor.GoLineTop(); Editor.Up_Sel(); return Editor.GetSel…