From 82b913fb17ccd8b3b308d70de99e847ce05ca5a9 Mon Sep 17 00:00:00 2001 From: Francesc Campoy Date: Mon, 4 Aug 2014 15:55:39 -0700 Subject: [PATCH] playground: add ctrl-enter shortcut for gofmt (as in the tour) LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/120420044 --- godoc/static/playground.js | 3 +++ godoc/static/static.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/godoc/static/playground.js b/godoc/static/playground.js index 84011579..59d4cdab 100644 --- a/godoc/static/playground.js +++ b/godoc/static/playground.js @@ -285,6 +285,9 @@ function PlaygroundOutput(el) { run(); e.preventDefault(); return false; + } if (e.ctrlKey) { // +control + fmt(); + e.preventDefault(); } else { autoindent(e.target); } diff --git a/godoc/static/static.go b/godoc/static/static.go index 2adb8858..6dad04f6 100644 --- a/godoc/static/static.go +++ b/godoc/static/static.go @@ -2307,6 +2307,9 @@ function PlaygroundOutput(el) { run(); e.preventDefault(); return false; + } if (e.ctrlKey) { // +control + fmt(); + e.preventDefault(); } else { autoindent(e.target); }