This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Ctrl-L to select line #2002
Merged
Merged
Ctrl-L to select line #2002
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2ccd4ce
Ctrl+L selects line + menu item for select line
spiroski 97cf253
sugestions implemented
spiroski c3f3e69
Merging from master to cover up delay
pritambaral 1e1b14f
Ctrl-L on Mac. Now expands selection on repeat
pritambaral 6c4c4d3
Corrects mistakes
pritambaral 2bc0bcb
Merging from master, adding var keyword
pritambaral 7555e14
Corrected syntax and indentation
pritambaral File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,8 +35,7 @@ define(function (require, exports, module) { | |
var Commands = require("command/Commands"), | ||
Strings = require("strings"), | ||
CommandManager = require("command/CommandManager"), | ||
EditorManager = require("editor/EditorManager"), | ||
Editor = require("editor/Editor").Editor; | ||
EditorManager = require("editor/EditorManager"); | ||
|
||
|
||
/** | ||
|
@@ -263,7 +262,15 @@ define(function (require, exports, module) { | |
|
||
editor._codeMirror.execCommand("indentLess"); | ||
} | ||
|
||
function selectLine() { | ||
var editor = EditorManager.getFocusedEditor(); | ||
if (editor) { | ||
from = {line: editor.getSelection().start.line, ch: 0}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
to = {line: editor.getSelection().end.line + 1, ch: 0}; | ||
editor.setSelection(from, to); | ||
} | ||
} | ||
|
||
/** | ||
* Toggles tabs/spaces preferences | ||
*/ | ||
|
@@ -282,4 +289,5 @@ define(function (require, exports, module) { | |
CommandManager.register(Strings.CMD_LINE_DOWN, Commands.EDIT_LINE_DOWN, moveLineDown); | ||
CommandManager.register(Strings.CMD_USE_TAB_CHARS, Commands.TOGGLE_USE_TAB_CHARS, toggleUseTabChars) | ||
.setChecked(Editor.getUseTabChar()); | ||
CommandManager.register(Strings.CMD_SELECT_LINE), Commands.EDIT_SELECT_LINE, selectLine); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an extra |
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,7 @@ define({ | |
// Edit menu commands | ||
"EDIT_MENU" : "Edit", | ||
"CMD_SELECT_ALL" : "Select All", | ||
"CMD_SELECT_ALL" : "Select Line", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy-paste error: the key should be "CMD_SELECT_LINE" |
||
"CMD_FIND" : "Find", | ||
"CMD_FIND_IN_FILES" : "Find in Files", | ||
"CMD_FIND_NEXT" : "Find Next", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch on the unneeded dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks but that wasn't a catch. I just merged master into @deemeetar's old branch. Maybe the merge went wrong on my side, but the said dependency is indeed required by toggleUseTabChars(). Can you review that function and point me if it is valid, I will correct it otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Well luckily it turns out, toggleUseTabChars() was moved to a different module recently. So when you merge with master, that code will go away and the dependency on Editor will indeed no longer be needed.