Skip to content

Instantly share code, notes, and snippets.

function a(...a) {
return a;
}
console.log(a(1,2,3));
//[1, 2, 3]
function b({a: [b,...c]}, ...d) {
return [c, d];
}
console.log(b({a:[1,2,3,4]},5,6,7,8,9));
@caisui
caisui / _vimperatorrc
Created November 21, 2011 13:00
liberator-overlay-ext の 残骸
# mapping の 当て方
:js mappings.addUserMap([modes.COMMAND_LINE], ["<C-g>"], "toggle completions list", function () plugins.toggleFloatBox.toggleBox());
@caisui
caisui / gist:1351332
Created November 9, 2011 12:45
vimperatorrc を here doc で 遅延
" plugin load 後実行
" Enter 後、:source 時は、遅延無しで実行
" here doc の ネスト 可能
:js <<END
{
let one= function (f1) liberator.registerObserver("enter", function f2() {f1(); liberator.unregisterObserver("enter", f2);});
let c = commands.addUserCommand(["lazy"], "lazy", function (args, extra) {
function f() {
io.source({
@caisui
caisui / hello.coffee
Created October 22, 2011 02:03
CoffeeScript で Command 追加
commands.addUserCommand ["hel[lo]"], "Coffee Script Command Sample",
([name])->liberator.echo "Hello #{name}",
{
argCount: "1",
completer: (context, args)->
context.completions = [
["CoffeeScript", "Description1"]
["Vimperator", "Description2"]
["ECMAScript", "Description3"]
]
// vim:set fdm=marker et sw=4 ts=4:
var INFO = //{{{
<plugin name="treeStyleTab" version="0.0.2"
href="http://github.com/caisui/vimperator/blob/master/plugin/treeStyleTab.js"
summary="Tree Stye Tab"
xmlns="http://vimperator.org/namespaces/liberator">
<author href="http://d.hatena.ne.jp/caisui">caisui</author>
<license href="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>
<project name="Vimperator" minVersion="2.0"/>
<item>
#!/usr/bin/python
# -*- coding: utf8 -*-
from mercurial.i18n import _
from mercurial import ui, hg
from mercurial import extensions, patch, cmdutil, commands
def committohookfunc(repo, commitfunc, **opts):
def _commitfunc(ui, repo, *pats, **opts):
opts = opts.copy()
# HG changeset patch
# Parent 2183248b822c8bd6792990e0d52c7b25c63644d1
diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm
--- a/common/modules/storage.jsm
+++ b/common/modules/storage.jsm
@@ -274,6 +274,11 @@
var storage = {
alwaysReload: {},
newObject: function newObject(key, constructor, params) {
+ if (!params.reload && !params.store) {
diff --git a/common/content/commands.js b/common/content/commands.js
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -915,14 +915,22 @@
}
// highlight non-existent commands
- let command = commands.get(cmd);
+ let command = Commands.prototype.get.call(subCmds ? {_exCommands: subCmds} : commands, cmd);
if (!command) {
.tabbrowser-tab::before {
display: inline-block;
padding-top: 8px;
content: attr(pos);
font-weight: bold;
color: #eee;
font-size: 0.8em;
margin-right: -1em;
z-index:65535;
position:relative;
diff --git a/common/content/modes.js b/common/content/modes.js
--- a/common/content/modes.js
+++ b/common/content/modes.js
@@ -226,6 +226,8 @@
this._modeStack = [];
if (config.isComposeWindow)
this.set(modes.COMPOSE, modes.NONE, silent);
+ else if (liberator.has("tabview") && TabView.isVisible() && liberator.mode !== modes.PANORAMA)
+ this.set(modes.PANORAMA, modes.NONE, silent);
else