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

Already on GitHub? Sign in to your account

Write to a temporary file, and reload it un updates #3

Merged
merged 7 commits into from Sep 5, 2017

Conversation

Projects
None yet
2 participants
Contributor

larstvei commented Sep 5, 2017

Hi!

These commits makes the following changes:

  • Use a temporary file, instead of a user-specified file
  • If no region is selected, send the entire buffer
  • Automatic reloading in Grammarly when invoking grammarly-save-region-and-run

There is a major caveat: if Grammarly is open, and is not visiting the temporary file we create, then reloading doesn't work. I haven't found a solution to this yet, but I do think it offers a higher degree of automation than before.

The second caveat (which I'm pretty sure was present before my changes), is that Grammarly stores the old version of the file, so it leaves quite a bit of garbage.

larstvei added some commits Sep 4, 2017

Reload Grammarly after file change
After a file change, Grammarly must manually be reloaded. This can be fixed
with a small chunk of (ugly) applescript.
Use a single temporary file for Grammarly
Sadly, reloading only works for updating the same file, so having one for each
buffer does not work with the current solution.

There is still a problem with `open -a Grammarly` not doing anything if
Grammarly is already open, so the solution assumes that Grammarly is closed or
that the user is visiting the generated file in Grammarly.

@mmagnus mmagnus merged commit 6cd807b into mmagnus:master Sep 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment