Gedit keeps saying a file "has been externally modified"

I keep getting the following popup from gedit

The file “~/mnt/folder/file.txt” has been externally modified.
If you save it, all the external changes could be lost. Save it anyway?
[Save Anyway]
[Don’t Save]

when I have not made any external changes. I know that I have not made any such changes because (a) the file is not open anywhere else and (b) I just saved the file two seconds ago.

Sometimes, I could go through the routine of hitting the “Save” button, seeing the popup, and hitting “Save Anyway” several times in a row.

More facts:

  • My Manjaro is the stable branch.
  • My Manjaro runs in a virtual machine (in VMware), and the files in question are in a Windows 11 location.
  • I do not seem to get the same problem with a file saved in a Manjaro location. (This I say from having experimented just now: Even though I am at present having the problem with all files in a Windows location, I cannot replicate it with a file in Manjaro. But I suppose this result is not as reliable as that from long observation.)
  • The problem may have become worse after the 2024-05-29 update. Since then, I get it about every two or three days. Once I “get” it, I can count on seeing the popup every time I try to save. If I go through the “routine” as above, the popup may cease to appear after two to four iterations. But if I wait for ten seconds and try to save again, I will see the popup again. Rebooting seems to fix the problem temporarily.
  • Before 2024-05-29 update, I might have got the problem once a week or month or at any rate so infrequently that I paid it no attention.

Any insight on how I might fix it?

This seems to describe typical behaviour from gedit, as far as I recall.

I have a similar experience occasionally with (example) Kate, where the opening of a file in memory causes an instance to be created (in lieu of possibly saving subsequent edits) and one must choose to whether to save or discard it, when closing.

You might consider using another editor; for example geany;

sudo pacman -S geany geany-plugins

…as an alternative, depending on your needs.

Thank you. geany is very nice.

Would you know which line would be the background color in the conf file such as this: https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/abc-dark.conf

The link above is the first theme from this page: Themes | Geany

ADDED LATER

I was able to find it. It’s second color item in this segment, i.e. #1C1C1C in the example. I am leaving this comment for anybody who might chance to look for the same info.

[named_styles]

default=#dbdbdb;#1C1C1C;false;false

Not from memory, even though I played with a few custom themes in older versions; though I imagine it’s this line:

default=#dbdbdb;#1C1C1C;false;false

…with the background first (a light grey) and the foregound second (charcoal-ish)… or vice-versa.

Speaking of older [theme] versions this page has a few notes to consider.

If you like darker themes, this one seems popular lately:

Cheers.

1 Like

Thanks again.

Would you also know how to indent only the first line of wrapped lines of a single paragraph?

It would look like this (although the following is not a single paragraph).

  It is a period of civil war.
Rebel spaceships, striking
from a hidden base, have won
their first victory against
the evil Galactic Empire.

I tried Edit > Preferences > Auto-Indent Mode = None, but that wasn’t it.

ADDED LATER

I found the solution

  1. sudo nano /usr/share/geany/filedefs/filetypes.common
  2. Change line_wrap_indent=0;1; to line_wrap_indent=0;0;

Also ~/.config/geany/filedefs/filetypes.README says:

Copy files from /usr/share/geany/filedefs to this directory to overwrite them.

And so you could do that so that all your edits (settings) are somewhere in your home directory.

I suspect Geany does not allow that type of fine-grained control, being that it’s primarily focused as a coding tool. If you want an editor for general writing, perhaps one of the markdown based apps would be more suitable.

An advantage would be that layout and general theming of a document is often achieved using only (basic) CSS; or plugins. I personally use Obsidian for many projects from simple note-taking through to complex articles.

sudo pacman -S obsidian

GhostWriter is another useful application; markdown based; with powerful export capability when coupled with pandoc. One can craft the original document in markdown and then export using standard or custom templates to PDF, TeX, HTML; even Word/Writer document formats.

sudo pacman -S pandoc ghostwriter

I hope this helps. Cheers.

1 Like