geany does not handle properly creating multiple times the same document
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linux Mint |
New
|
Undecided
|
Unassigned | ||
geany (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Distro: Linux Mint 17.1 Rebecca 64-bit
If you run geany on a non-existing file name twice, it will open two tabs, without realizing it will write to the same file.
You may then edit both documents separately and each time you save one of them, you will clobber the changes of the other document, so that the last save wins.
Just one of the tabs will realize that the document has changed in disk, if you additionally modify it from outside.
Basically to test it,
$ geany doc.txt & geany doc.txt &
* Write something in one tab and save.
* Write something in the other tab an save.
You lose forever the changes in the first tab, silently.
I think that geany could try to figure out the final destination of the saving, even if the file does not exist, and just select this tab.
To understand my scenario, I have a simple script for keeping a personal log that opens a file with the name of the current day. If I run it twice in a row before the file exists, I get multiple tabs for the same day, which turns out to be really inconvenient for me.
The problem might be a design limitation. The function document_ find_by_ real_path does not consider not-yet-existing files.
GeanyDocument* document_ find_by_ real_path( const gchar *realname)
{
guint i;
if (! realname)
return NULL; /* file doesn't exist on disk */