// // 複写 (2014/05/31) // by mobitan http://mobitan.org/ // // 選択範囲を行単位に拡張 #Extend = 1; // 0:しない 1:改行を含む場合のみ 2:する setcompatiblemode 0x12020F; begingroupundo; disabledraw; if (rectselecting) { tomultiselect; } if (multiselecting) { call MultiSelected; } else if (selecting) { call Selected; } else { call NoSelected; } enabledraw; endgroupundo; endmacro; NoSelected: dupline 1; return; Selected: if (#Extend == 2 || (#Extend == 1 && seltoplineno != selendlineno)) { selectline 1; } call Core; return; MultiSelected: $$w1 = currentmacrobasename + "#selection1"; $$w2 = currentmacrobasename + "#selection2"; colormarker 0xFFFFFF, 0xFF6666, 11, 2, 0, $$w1; ##bx = seltopx; ##by = seltopy; gofiletop; nextcolormarker 0x09, 0, $$w1; while (result) { beginsel; nextcolormarker 0x0A, 0, $$w1; endsel; deletecolormarker $$w1; call Core; colormarker 0xFFFFFF, 0x993333, 11, 2, 0, $$w2; nextcolormarker 0x01, 0, $$w1; } moveto ##bx, ##by; selectcolormarker $$w2; deletecolormarker $$w2; return; Core: ##dx = selendx; ##dy = selendy; $$text = gettext(seltopx, seltopy, selendx, selendy, false); moveto ##dx, ##dy; insert $$text; beginsel; moveto ##dx, ##dy; endsel; return; // (c) mobitan 2014