rundis / elm-light

Elm language plugin for Light Table
https://rundis.gitbooks.io/elm-light-guide/content/
MIT License
133 stars 10 forks source link

:elm.browse doesn't work if allready opened #36

Closed Spenhouet closed 8 years ago

Spenhouet commented 8 years ago

If i open a file in the internal browser with :elm.browse (per keymap) it works. If i than make changes on the elm file and try again to open it via :elm.browse it doesn't reload the browser tab. The browser tab still contains the old file.

If i close the tab manually and do :elm.browse it works. But i don't think that this is the desired behavior.

Keymap: [:editor.elm "ctrl-b" :elm.browse] I'm using a fresh installation with elm 0.18, lighttable 0.8.1, elm-light 0.5, node v6.9.1 on Win10.

rundis commented 8 years ago

Does the other file have a main function ?

Spenhouet commented 8 years ago

The other file?

What i mean is, i only have one elm file (for example the form.elm of the example files: https://github.com/evancz/elm-architecture-tutorial/blob/master/examples/03-form.elm). This file does have a main:

main : Program Never Model Msg
main = Html.beginnerProgram { model = model, view = view, update = update }

Repro:

  1. Open form.elm
  2. :elm.browse => the file is shown correctly in the internal browser
  3. Change for example the String "OK" to something else
  4. :elm.browse => still shows "OK" should show the new text
rundis commented 8 years ago

Ok. That's probably the default behavior of the in-buildt chromium browser. In any case just use cmd/ctrl - r to refresh

Spenhouet commented 8 years ago

You are right. That is a simple and good idea. I just changed my keymap to: [:editor.elm "ctrl-b" :elm.browse :refresh-connected-browser]

The :refresh-connected-browser after :elm.browse does the trick. Thank you for your help 👍

rundis commented 8 years ago

np !