mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
add Ctrl-Enter hotkey
This commit is contained in:
parent
27795c451f
commit
1d6314a2c1
3 changed files with 16 additions and 2 deletions
|
@ -26,7 +26,8 @@ div.full-size(
|
||||||
goto-line="editor.gotoLine",
|
goto-line="editor.gotoLine",
|
||||||
resize-on="layout:main:resize,layout:pdf:resize",
|
resize-on="layout:main:resize,layout:pdf:resize",
|
||||||
annotations="pdf.logEntryAnnotations[editor.open_doc_id]",
|
annotations="pdf.logEntryAnnotations[editor.open_doc_id]",
|
||||||
read-only="!permissions.write"
|
read-only="!permissions.write",
|
||||||
|
on-ctrl-enter="recompile"
|
||||||
)
|
)
|
||||||
|
|
||||||
.ui-layout-east
|
.ui-layout-east
|
||||||
|
|
|
@ -34,7 +34,8 @@ define [
|
||||||
text: "="
|
text: "="
|
||||||
readOnly: "="
|
readOnly: "="
|
||||||
annotations: "="
|
annotations: "="
|
||||||
navigateHighlights: "="
|
navigateHighlights: "=",
|
||||||
|
onCtrlEnter: "="
|
||||||
}
|
}
|
||||||
link: (scope, element, attrs) ->
|
link: (scope, element, attrs) ->
|
||||||
# Don't freak out if we're already in an apply callback
|
# Don't freak out if we're already in an apply callback
|
||||||
|
@ -76,6 +77,15 @@ define [
|
||||||
ace.require("ace/ext/searchbox").Search(editor, true)
|
ace.require("ace/ext/searchbox").Search(editor, true)
|
||||||
readOnly: true
|
readOnly: true
|
||||||
editor.commands.removeCommand "replace"
|
editor.commands.removeCommand "replace"
|
||||||
|
|
||||||
|
scope.$watch "onCtrlEnter", (callback) ->
|
||||||
|
if callback?
|
||||||
|
editor.commands.addCommand
|
||||||
|
name: "compile",
|
||||||
|
bindKey: win: "Ctrl-Enter", mac: "Command-Enter"
|
||||||
|
exec: (editor) =>
|
||||||
|
callback()
|
||||||
|
readOnly: true
|
||||||
|
|
||||||
# Make '/' work for search in vim mode.
|
# Make '/' work for search in vim mode.
|
||||||
editor.showCommandLine = (arg) =>
|
editor.showCommandLine = (arg) =>
|
||||||
|
|
|
@ -107,6 +107,9 @@ define [
|
||||||
.error () ->
|
.error () ->
|
||||||
$scope.pdf.compiling = false
|
$scope.pdf.compiling = false
|
||||||
$scope.pdf.error = true
|
$scope.pdf.error = true
|
||||||
|
|
||||||
|
# This needs to be public.
|
||||||
|
ide.$scope.recompile = $scope.recompile
|
||||||
|
|
||||||
$scope.clearCache = () ->
|
$scope.clearCache = () ->
|
||||||
$http {
|
$http {
|
||||||
|
|
Loading…
Reference in a new issue