- anekos
- New BSD License
-
-
- ~からデータを転送していますなどの表示を消したり、ステータスラインに移動したり、echo したり。
-
- -
- g:no_reading_do_echo
- let g:no_reading_do_echo
- liberator.globalVariables.no_reading_do_echo
-
-
echo で代用
-
-
- -
- g:no_reading_on_statusline
- let g:no_reading_on_statusline
- liberator.globalVariables.no_reading_on_statusline
-
-
表示をステータスラインに移動
-
-
-
->;
-// }}}
-
-(function () {
-
- let eraseTimerHandle;
- let label;
- let (
- sl = document.getElementById('liberator-statusline'),
- slfu = document.getElementById('liberator-statusline-field-inputbuffer')
- ) {
- label = document.createElement('label');
- label.setAttribute('id', 'vimperator-plugin-no-reading-label');
- sl.insertBefore(label, slfu);
- }
-
- let $ = {
- get doEcho ()
- liberator.globalVariables.no_reading_do_echo,
-
- get onStatusLine ()
- !!liberator.globalVariables.no_reading_on_statusline,
-
- get statuslineLimit ()
- liberator.globalVariables.no_reading_statusline_limit
- };
-
- let (doErase = true)
- liberator.plugins.libly.$U.around(
- statusline,
- 'updateUrl',
- function (next, args) {
- function setLabel (status) {
- label.tooltipText = status;
- label.value = status;
- }
-
- function updateStatus (status) {
- doErase = true;
- if ($.onStatusLine) {
- eraseTimerHandle && clearTimeout(eraseTimerHandle);
- if ($.statuslineLimit) {
- eraseTimerHandle =
- setTimeout(
- function () (eraseTimerHandle = null, setLabel('')),
- $.statuslineLimit
- );
- }
- setLabel(status);
- } else {
- if ($.doEcho)
- liberator.echo(status, commandline.FORCE_SINGLELINE)
- }
- }
-
- function showURL () {
- if ($.onStatusLine) {
- setLabel('');
- } else {
- if (doErase && $.doEcho)
- liberator.echo('', commandline.FORCE_SINGLELINE)
- }
- doErase = false;
- return next();
- }
-
- let [url] = args;
- return (url ? updateStatus : showURL)(url);
- }
- );
-
-})();
-
-// vim:sw=2 ts=2 et si fdm=marker:
--
cgit v1.2.3