Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost buffer and browser text field contents after C-c C-c #52

Open
mpereira opened this issue Dec 4, 2019 · 2 comments
Open

Lost buffer and browser text field contents after C-c C-c #52

mpereira opened this issue Dec 4, 2019 · 2 comments

Comments

@mpereira
Copy link

mpereira commented Dec 4, 2019

This is what I see in the browser console:

Got message: Objectaction: "select-field"tabId: 7126__proto__: Object
content.js:150 GhostText: selectField()
content.js:82 GhostText: There are multiple textarea elements on this page. 
 Click on the one you want to use.
content.js:154 GhostText: detector.focusEvent()
content.js:206 GhostText: reportFieldData()
content.js:39 Got message: Objectaction: "enable-field"tabId: 7126__proto__: Object
content.js:176 GhostText: enableField()
content.js:82 GhostText: Connected! You can switch to your editor
content.js:206 GhostText: reportFieldData()
1000Error in event handler: TypeError: Cannot read property 'length' of undefined
    at Function.fromPlainJS (<URL>)
    at <URL>
content.js:39 Got message: Objectaction: "disable-field"tabId: 7126__proto__: Object
content.js:132 GhostText: disableField()
content.js:82 GhostText: Disconnected! 
 <a href="https://github.com/GhostText/GhostText/issues?state=open" target="_blank">Report issues</a> | <a href="https://chrome.google.com/webstore/detail/sublimetextarea/godiecgffnchndlihlpaajjcplehddca/reviews" target="_blank">Leave review</a>

Screenshot:
image

Does it make sense that, no matter what, atomic-chrome shouldn't kill buffers? At most it should bury them? And additionally, maybe it makes sense to persist buffers in files?

atomic-chrome 20180617.724 (2.0.0)
Emacs 26.3
Chrome 78.0.3904.87
@mpereira
Copy link
Author

mpereira commented Dec 4, 2019

I added the following to my Emacs configuration:

(use-package atomic-chrome
  :config
  (setq atomic-chrome-url-major-mode-alist
        '(("github\\.com" . gfm-mode)))

  (atomic-chrome-start-server)

  (defun mpereira/prevent-buffer-kill ()
    (interactive)
    (emacs-lock-mode 'kill))

  (add-hook 'atomic-chrome-edit-mode-hook #'mpereira/prevent-buffer-kill))

mpereira/prevent-buffer-kill causes the buffer to not be killed on C-c C-c, requiring me to click the GhostText button to disconnect instead. For me, this inconvenience is worth not risking losing buffers.

@tsuu32
Copy link
Contributor

tsuu32 commented Feb 4, 2020

In my environment, text field don't lost contents by C-c C-c .

atomic-chrome 20180617.724
Emacs 26.3
Chrome 79.0
GhostText 17.12.11.910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants