「行末の空白を削除」の版間の差分
見出しの修正 |
文の末尾にセミコロンを追加 |
||
| 7行目: | 7行目: | ||
/* 行末の空白を削除.js r0 2014-11-28 */ | /* 行末の空白を削除.js r0 2014-11-28 */ | ||
var state = new StateBackup() | var state = new StateBackup(); | ||
var something = document.selection.IsEmpty ? document : document.selection | var something = document.selection.IsEmpty ? document : document.selection; | ||
state.Backup() | state.Backup(); | ||
window.Redraw = false | window.Redraw = false; | ||
something.Text = something.Text.replace(/[ \u3000\t\v\f]+$/gm, "") | something.Text = something.Text.replace(/[ \u3000\t\v\f]+$/gm, ""); | ||
state.Restore() | state.Restore(); | ||
window.Redraw = true | window.Redraw = true; | ||
/* ks氏の StateBackup.js ( https://www.haijin-boys.com/wiki/include%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA ) を改変して利用させて頂いています */ | /* ks氏の StateBackup.js ( https://www.haijin-boys.com/wiki/include%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA ) を改変して利用させて頂いています */ | ||
| 45行目: | 45行目: | ||
this.ancPosX = sel.GetAnchorPointX(mePosLogical); | this.ancPosX = sel.GetAnchorPointX(mePosLogical); | ||
this.ancPosY = sel.GetAnchorPointY(mePosLogical); | this.ancPosY = sel.GetAnchorPointY(mePosLogical); | ||
this._isBoxed = (sel.GetBottomPointY(mePosView) - sel.GetTopPointY(mePosView)) != (sel.Text.match(/\n/g) || []).length | this._isBoxed = (sel.GetBottomPointY(mePosView) - sel.GetTopPointY(mePosView)) != (sel.Text.match(/\n/g) || []).length; | ||
} | }; | ||
/** | /** | ||
| 58行目: | 58行目: | ||
ScrollX = this.scrollX; | ScrollX = this.scrollX; | ||
ScrollY = this.scrollY; | ScrollY = this.scrollY; | ||
} | }; | ||
// Initialize | // Initialize | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
スポンサーリンク