| author | Max Li | 2012-03-02 15:53:26 (EST) |
|---|---|---|
| committer | Silenio Quarti | 2012-03-06 13:18:26 (EST) |
| commit | fa60c23e9b21b804483d204f0e52c0651693a44e (patch) (side-by-side diff) | |
| tree | 5a6931d2c3cc685a21bf7a336ff8c4ca9684b815 | |
| parent | fd7bb9505b6211ab4cefbfb650d8f4fd931a1861 (diff) | |
| download | org.eclipse.orion.client-fa60c23e9b21b804483d204f0e52c0651693a44e.zip org.eclipse.orion.client-fa60c23e9b21b804483d204f0e52c0651693a44e.tar.gz org.eclipse.orion.client-fa60c23e9b21b804483d204f0e52c0651693a44e.tar.bz2 | |
Bug 372765 - Provide accessible way to discover current line
| -rw-r--r-- | bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js index 6613dbc..916e826 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js @@ -117,7 +117,11 @@ exports.EditorCommandFactory = (function() { this.commandService.registerCommandContribution(this.toolbarId, "orion.save", 1, "orion.editorActions.unlabeled", false, new mCommands.CommandKeyBinding('s', true)); // page navigation commands (go to line) - var lineParameter = new mCommands.ParametersDescription([new mCommands.CommandParameter('line', 'number', 'Line:')], false); + var lineParameter = new mCommands.ParametersDescription([new mCommands.CommandParameter('line', 'number', 'Line:')], false, + function() { + var line = editor.getModel().getLineAtOffset(editor.getCaretOffset()) + 1; + return [new mCommands.CommandParameter('line', 'number', 'Line:', line.toString())]; + }); var gotoLineCommand = new mCommands.Command({ name: "Go to Line", |

