Sublime Text Plugins - views / regions / selections
April 26, 2016
This is about how views regions and seletions all fit together when creating sublime text plugins
my @a = (1,2,3);
for(@a) {
print $_."\n";
}
#=> prints the arrayClass inheritance in JavaScript
Here’s some minimal JavaScript to demonstrate using class inheritance. This is in monospace.
Some subheading
ethethethethe… Chris Waddle
a deeper heading
a blockquote
Some words of wisdom.
- do sammink
- do sammink else
- do anava fing
var Parent = function(args) {
console.log('Parent() constructor called')
this.a = args.a
}
Shopping list:
- apples
- oranges
- pears
Numbered list:
- apples
- oranges
- pears
/* define the parent 'class' */
var Parent = function(args) {
console.log('Parent() constructor called')
this.a = args.a
}
Parent.prototype.methodA = function() {
console.log('calling methodA()')
}
/* define the child 'class' */
var Child = function(args) {
// call the Parent constructor
this.__proto__.constructor(args)
console.log('Child() constructor called')
this.b = args.b
}
// inherit from the Parent prototype
Child.prototype = Object.create(Parent.prototype);
// create method on Child prototype
Child.prototype.methodB = function() {
console.log('calling methodB()')
}
/* create child and check */
var child = new Child({ a: 1, b: 2 });
console.log("child.a", child.a)
console.log("child.b", child.b)
child.methodA()
child.methodB()Check out the My blog for stuff.