mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-29 06:54:07 +00: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",
|
||||
resize-on="layout:main:resize,layout:pdf:resize",
|
||||
annotations="pdf.logEntryAnnotations[editor.open_doc_id]",
|
||||
read-only="!permissions.write"
|
||||
read-only="!permissions.write",
|
||||
on-ctrl-enter="recompile"
|
||||
)
|
||||
|
||||
.ui-layout-east
|
||||
|
|
|
@ -34,7 +34,8 @@ define [
|
|||
text: "="
|
||||
readOnly: "="
|
||||
annotations: "="
|
||||
navigateHighlights: "="
|
||||
navigateHighlights: "=",
|
||||
onCtrlEnter: "="
|
||||
}
|
||||
link: (scope, element, attrs) ->
|
||||
# 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)
|
||||
readOnly: true
|
||||
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.
|
||||
editor.showCommandLine = (arg) =>
|
||||
|
|
|
@ -107,6 +107,9 @@ define [
|
|||
.error () ->
|
||||
$scope.pdf.compiling = false
|
||||
$scope.pdf.error = true
|
||||
|
||||
# This needs to be public.
|
||||
ide.$scope.recompile = $scope.recompile
|
||||
|
||||
$scope.clearCache = () ->
|
||||
$http {
|
||||
|
|
Loading…
Reference in a new issue