alexandervdm / gummi

Simple LaTeX editor
https://gummi.app
MIT License
738 stars 94 forks source link

Request: Reload Document #167

Open cmahte opened 2 years ago

cmahte commented 2 years ago

Missing Menu Item: Reload Document. Hopefully with a shortcut

This is an alternative/interim for Issue 162 that would fill a hole (missing regex replace) to quickly producing lots of tweaked documents.

That is, this is a way to allow Gummi to quickly render files edited externally (with a REGEX enabled editor.)

Vectornaut commented 2 years ago

Seconded! I like the way gedit responds when a file gets changed externally, and I'd love to make Gummi act the same. More broadly, I'd like to make Gummi's file recovery feature work more smoothly with intentional external file changes, such as:

Feedback from people who use Gummi's file recovery feature would be very helpful here.

Implementing an offer to load external changes

When a gedit tab gains focus (view_focused_in), it checks whether the associated file has been changed externally (gtk_source_file_is_externally_modified). If so, the tab shows an info bar offering to reload the file.

Gummi can already display info bars (like in gui_recovery_mode_enable) and check whether a tab's associated file has been changed (using GuTabContext*->editor->last_modtime), so it might be relatively easy to imitate gedit's behavior.

Changing the file recovery feature

When I use Git to manage LaTeX projects, the file recovery feature adds two annoying steps (in bold) to my workflow.

  1. Check out a commit.
  2. Open a file.
  3. Dismiss the file recovery offer.
  4. Reload the file to get rid of the editor_buffer_changed asterisk in the tab name.

Here's the simplest fix I can think of.

However, I'd love a fix that demands less action from the user. Thoughts?

Vectornaut commented 2 years ago

I've prototyped a gedit-style external changes procedure! It's on the load-changes branch of my fork. Should I make a pull request?

What it does

Polishing it would need before production

Further polishing that might be nice