Skip to content

Commit

Permalink
clean up unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
misfo committed Sep 12, 2011
1 parent 9386bf5 commit 360a421
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 30 deletions.
44 changes: 21 additions & 23 deletions build/jim-ace.debug.js
Expand Up @@ -559,7 +559,7 @@ module.exports = {

require['./operators'] = (function() {
var exports = {}, module = {};
var Change, Command, Delete, GoToLine, Indent, MoveToBigWordEnd, MoveToFirstNonBlank, MoveToNextBigWord, MoveToNextWord, MoveToWordEnd, Operation, Outdent, Yank, defaultMappings, map, _ref;
var Change, Command, Delete, GoToLine, Indent, MoveToFirstNonBlank, Operation, Outdent, Yank, defaultMappings, map, _ref;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
Expand All @@ -569,10 +569,10 @@ var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, par
return child;
};
Command = require('./helpers').Command;
_ref = require('./motions'), GoToLine = _ref.GoToLine, MoveToFirstNonBlank = _ref.MoveToFirstNonBlank, MoveToNextBigWord = _ref.MoveToNextBigWord, MoveToNextWord = _ref.MoveToNextWord, MoveToBigWordEnd = _ref.MoveToBigWordEnd, MoveToWordEnd = _ref.MoveToWordEnd;
_ref = require('./motions'), GoToLine = _ref.GoToLine, MoveToFirstNonBlank = _ref.MoveToFirstNonBlank;
defaultMappings = {};
map = function(keys, operatorClass) {
return defaultMappings[keys] = operatorClass;
map = function(keys, operationClass) {
return defaultMappings[keys] = operationClass;
};
Operation = (function() {
__extends(Operation, Command);
Expand Down Expand Up @@ -703,7 +703,7 @@ module.exports = {

require['./commands'] = (function() {
var exports = {}, module = {};
var Backspace, Change, ChangeChar, ChangeToEndOfLine, Command, Delete, DeleteChar, DeleteToEndOfLine, GoToLine, Insert, InsertAfter, InsertAtEndOfLine, InsertBeforeFirstNonBlank, JoinLines, JoinLinesNormalizingWhitespace, ModeSwitch, MoveDown, MoveLeft, MoveRight, MoveToEndOfLine, MoveToFirstNonBlank, OpenLine, OpenLineAbove, Paste, PasteBefore, RepeatCommand, ReplaceChar, ReplaceSwitch, Undo, VisualLinewiseSwitch, VisualSwitch, defaultMappings, map, repeatCountTimes, _ref, _ref2, _ref3;
var Backspace, ChangeChar, ChangeToEndOfLine, Command, Delete, DeleteChar, DeleteToEndOfLine, Insert, InsertAfter, InsertAtEndOfLine, InsertBeforeFirstNonBlank, JoinLines, JoinLinesNormalizingWhitespace, ModeSwitch, MoveLeft, MoveRight, MoveToEndOfLine, MoveToFirstNonBlank, OpenLine, OpenLineAbove, Paste, PasteBefore, RepeatCommand, ReplaceChar, ReplaceSwitch, Undo, VisualLinewiseSwitch, VisualSwitch, defaultMappings, map, repeatCountTimes, _ref, _ref2;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
Expand All @@ -713,8 +713,8 @@ var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, par
return child;
};
_ref = require('./helpers'), Command = _ref.Command, repeatCountTimes = _ref.repeatCountTimes;
_ref2 = require('./operators'), Change = _ref2.Change, Delete = _ref2.Delete;
_ref3 = require('./motions'), GoToLine = _ref3.GoToLine, MoveDown = _ref3.MoveDown, MoveLeft = _ref3.MoveLeft, MoveRight = _ref3.MoveRight, MoveToEndOfLine = _ref3.MoveToEndOfLine, MoveToFirstNonBlank = _ref3.MoveToFirstNonBlank;
Delete = require('./operators').Delete;
_ref2 = require('./motions'), MoveLeft = _ref2.MoveLeft, MoveRight = _ref2.MoveRight, MoveToEndOfLine = _ref2.MoveToEndOfLine, MoveToFirstNonBlank = _ref2.MoveToFirstNonBlank;
defaultMappings = {};
map = function(keys, commandClass) {
return defaultMappings[keys] = commandClass;
Expand Down Expand Up @@ -747,12 +747,12 @@ map('v', VisualSwitch = (function() {
});
};
VisualSwitch.prototype.visualExec = function(jim) {
var _ref4;
var _ref3;
if (jim.mode.linewise) {
jim.setMode('visual', {
linewise: false
});
return (_ref4 = jim.adaptor.editor.selection).setSelectionAnchor.apply(_ref4, jim.mode.anchor);
return (_ref3 = jim.adaptor.editor.selection).setSelectionAnchor.apply(_ref3, jim.mode.anchor);
} else {
return jim.onEscape();
}
Expand Down Expand Up @@ -909,8 +909,8 @@ map('gJ', JoinLines = (function() {
return _results;
};
JoinLines.prototype.visualExec = function(jim) {
var maxRow, minRow, _ref4;
_ref4 = jim.adaptor.selectionRowRange(), minRow = _ref4[0], maxRow = _ref4[1];
var maxRow, minRow, _ref3;
_ref3 = jim.adaptor.selectionRowRange(), minRow = _ref3[0], maxRow = _ref3[1];
jim.adaptor.clearSelection();
jim.adaptor.moveTo(minRow, 0);
this.count = maxRow - minRow + 1;
Expand Down Expand Up @@ -943,7 +943,7 @@ map('p', Paste = (function() {
Paste.__super__.constructor.apply(this, arguments);
}
Paste.prototype.exec = function(jim) {
var beforeLineEnding, column, lastRow, lineEnding, linewiseRegister, registerValue, row, text, wholeString, _ref4;
var beforeLineEnding, column, lastRow, lineEnding, linewiseRegister, registerValue, row, text, wholeString, _ref3;
if (!(registerValue = jim.registers['"'])) {
return;
}
Expand All @@ -953,7 +953,7 @@ map('p', Paste = (function() {
row = jim.adaptor.row() + (this.before ? 0 : 1);
lastRow = jim.adaptor.lastRow();
if (row > lastRow) {
_ref4 = /^([\s\S]*)(\r?\n)$/.exec(text), wholeString = _ref4[0], beforeLineEnding = _ref4[1], lineEnding = _ref4[2];
_ref3 = /^([\s\S]*)(\r?\n)$/.exec(text), wholeString = _ref3[0], beforeLineEnding = _ref3[1], lineEnding = _ref3[2];
text = lineEnding + beforeLineEnding;
column = jim.adaptor.lineText(lastRow).length - 1;
jim.adaptor.moveTo(row, column);
Expand Down Expand Up @@ -1218,8 +1218,7 @@ module.exports = Keymap;

require['./modes'] = (function() {
var exports = {}, module = {};
var MoveDown, MoveLeft, invalidCommand, _ref;
_ref = require('./motions'), MoveLeft = _ref.MoveLeft, MoveDown = _ref.MoveDown;
var invalidCommand;
invalidCommand = function(type) {
if (type == null) {
type = 'command';
Expand All @@ -1229,7 +1228,7 @@ invalidCommand = function(type) {
};
exports.normal = {
onKeypress: function(keys) {
var command, motion, regex, _ref2, _ref3;
var command, motion, regex, _ref, _ref2;
this.commandPart = (this.commandPart || '') + keys;
if (!this.command) {
command = this.keymap.commandFor(this.commandPart);
Expand All @@ -1250,7 +1249,7 @@ exports.normal = {
}
this.commandPart = '';
} else if (this.command.isOperation) {
if (regex = (_ref2 = this.command.motion) != null ? _ref2.constructor.followedBy : void 0) {
if (regex = (_ref = this.command.motion) != null ? _ref.constructor.followedBy : void 0) {
if (regex.test(this.commandPart)) {
this.command.motion.followedBy = this.commandPart;
} else {
Expand All @@ -1268,7 +1267,7 @@ exports.normal = {
}
}
}
if ((_ref3 = this.command) != null ? _ref3.isComplete() : void 0) {
if ((_ref2 = this.command) != null ? _ref2.isComplete() : void 0) {
this.command.exec(this);
if (this.command.isRepeatable) {
this.lastCommand = this.command;
Expand All @@ -1279,7 +1278,7 @@ exports.normal = {
};
exports.visual = {
onKeypress: function(newKeys) {
var command, maxRow, minRow, wasBackwards, _ref2, _ref3, _ref4;
var command, maxRow, minRow, wasBackwards, _ref, _ref2, _ref3;
this.commandPart = (this.commandPart || '') + newKeys;
if (!this.command) {
command = this.keymap.visualCommandFor(this.commandPart);
Expand All @@ -1298,9 +1297,9 @@ exports.visual = {
this.commandPart = '';
}
wasBackwards = this.adaptor.isSelectionBackwards();
if (((_ref2 = this.command) != null ? _ref2.isOperation : void 0) || ((_ref3 = this.command) != null ? _ref3.isComplete() : void 0)) {
if (((_ref = this.command) != null ? _ref.isOperation : void 0) || ((_ref2 = this.command) != null ? _ref2.isComplete() : void 0)) {
if (this.command.isRepeatable) {
this.command.selectionSize = this.mode.name === 'visual' && this.mode.linewise ? ((_ref4 = this.adaptor.selectionRowRange(), minRow = _ref4[0], maxRow = _ref4[1], _ref4), {
this.command.selectionSize = this.mode.name === 'visual' && this.mode.linewise ? ((_ref3 = this.adaptor.selectionRowRange(), minRow = _ref3[0], maxRow = _ref3[1], _ref3), {
lines: (maxRow - minRow) + 1
}) : this.adaptor.characterwiseSelectionSize();
this.command.linewise = this.mode.linewise;
Expand Down Expand Up @@ -1337,10 +1336,9 @@ exports.replace = {

require['./jim'] = (function() {
var exports = {}, module = {};
var GoToLine, Jim, Keymap;
var Jim, Keymap;
var __hasProp = Object.prototype.hasOwnProperty;
Keymap = require('./keymap');
GoToLine = require('./motions').GoToLine;
Jim = (function() {
Jim.VERSION = '0.2.0-pre';
function Jim(adaptor) {
Expand Down
2 changes: 1 addition & 1 deletion build/jim-ace.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/commands.coffee
Expand Up @@ -4,8 +4,8 @@
# normal mode.

{Command, repeatCountTimes} = require './helpers'
{Change, Delete} = require './operators'
{GoToLine, MoveDown, MoveLeft, MoveRight, MoveToEndOfLine, MoveToFirstNonBlank} = require './motions'
{Delete} = require './operators'
{MoveLeft, MoveRight, MoveToEndOfLine, MoveToFirstNonBlank} = require './motions'

# The default key mappings are specified alongside the definitions of each command.
# Accumulate the mappings so they can be exported.
Expand Down
3 changes: 1 addition & 2 deletions src/jim.coffee
Expand Up @@ -4,8 +4,7 @@
# `Command`s are passed an instance of `Jim` when they are executed which allows
# them to change Jim's state and manipulate the editor (through the `@adaptor`).

Keymap = require './keymap'
{GoToLine} = require './motions'
Keymap = require './keymap'

class Jim
@VERSION: '0.2.0-pre'
Expand Down
2 changes: 0 additions & 2 deletions src/modes.coffee
Expand Up @@ -14,8 +14,6 @@
# * chars expected to follow a command (e.g. when `r` is pressed, the next
# `@commandPart` will be the char that's used as the replacement)

{MoveLeft, MoveDown} = require './motions'

# Shame the user in the console for not knowing their Jim commands.
invalidCommand = (type = 'command') ->
console.log "invalid #{type}: #{@commandPart}"
Expand Down

0 comments on commit 360a421

Please sign in to comment.