x/tools/present: editable code is not sync'd between main slide and presenter slide #26177
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.2 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
What did you do?
Using go "present -notes" to show editing some codes in the editable .code/.play presentation slides with presenter notes window active.
What did you expect to see?
The edited codes are synced between the main window and the presenter window.
What did you see instead?
The edited code is not synced between the two windows. The changes are only shown in the active window, i.e. If editing process in the main window, the codes in the presenter window do not change, and vice versa.
Notes:
Bug in golang.org/x/tools/cmd/present/static/slides.js
Function setupPlayCodeSync adds EventListener in a loop using variable index i (probably expecting the inputHandler function is instantiated for each Listener).
It is not, there is only one instant of inputHandler, and the variable i will contain the last value of i, which is play.length.
One solution to this is as follow (Javascript coders probably could give better solution):
The text was updated successfully, but these errors were encountered: