fregante / GhostText

đź‘» Use your text editor to write in your browser. Everything you type in the editor will be instantly updated in the browser (and vice versa).
https://GhostText.fregante.com
MIT License
3.26k stars 116 forks source link

CodeMirror: input not syncing from editor back to browser #120

Closed techhazard closed 3 years ago

techhazard commented 6 years ago

Introduction

I just started using GhostText, and I really like the fact that I can finally use my Vim (:heart:) within Firefox (with extensions, even! :tada:)

In fact, I'm writing this very text using GhostText :smiley:

For my work I have to work in ServiceNow, which uses CodeMirror fields for code input. Sadly, this does not work as expected.

Linking GhostText to my editor seems to work just fine, and the contents of the field are visible and transferred to my editor. But changes I make from within my editor are not synced back to the browser. However, changes I make in the browser are synced to my editor.

This is also the case when I tried the example editors on the CodeMirror homepage (e.g. simple scrollbars example).

Since I saw CodeMirror mentioned on the Add-On page, I assumed it was already fully supported, hence this bugreport.

I would really like to use this to develop :blush:

Technical details

I'm getting the following errors in my console:

screenshot from 2017-12-04 16-39-48

If you want anything else, please ask, I'd by happy to supply it if I can.

fregante commented 6 years ago

The CodeMirror plugin has some bugs but it works for me in Sublime Text (+Firefox or Chrome). Can you try using Sublime Text to exclude any issues specific to the vim extension?

Probably you're just clicking the button too many times and that's buggy at the moment. Load the page, click the button and select the field, once.

techhazard commented 6 years ago

The CodeMirror plugin has some bugs but it works for me in Sublime Text (+Firefox or Chrome). Can you try using Sublime Text to exclude any issues specific to the vim extension?

I just tried it with sublime text, and the same thing happened; the changes only go one way. (browser->editor, not vice versa)

Probably you're just clicking the button too many times and that's buggy at the moment. Load the page, click the button and select the field, once.

I restarted the browser and made sure it was the only tab open. Then I started sublime text and clicked the button once. I then clicked the field I wanted to edit, and the same thing happened as before :-/ .

Sublime text works fine here on github, as did neovim; so I think it's probably not the vim extension.

Edit: thanks for the reply :smile:

Do you have any suggestions to further debug the issue?

techhazard commented 6 years ago

I see you're doing a rewrite.
Am I correct in assuming that will eventually fix the issue? Anything I can do to help?

fregante commented 6 years ago

Yeah the issue should be gone, however I realized that it doesn’t work on HTTPS sites because chrome thinks it’s mixed content (it shouldn’t) and the chromium bug has been inactive.

I have to write a big chunk of code to move the connection to background.js because of this. Super annoying. Plus holidays means this will get postponed for a while.

If you want to help you can adopt an editor extension, some of them are buggy.

techhazard commented 6 years ago

I'm not sure how much I can help, but at the very least I could help you test it. :-)

mcepl commented 6 years ago

Is this the reason why GhostText doesn't work on https://build.opensuse.org/ (e.g., take a look at this page)?

fregante commented 3 years ago

Can you test the new version? It hasn't been published to the stores yet: https://github.com/GhostText/GhostText/issues/172

mcepl commented 3 years ago

@fregante Sorry, I switched to firenvim already and I don’t think I am looking back.