save (ctrl-s function) normally does not save if no changes are made. However if file timestamp has changed since opening (by someone else) prompt user to decide what to do (save or not)
This commit is contained in:
parent
c708050baf
commit
6d08202a5d
|
|
@ -450,7 +450,18 @@ const char *get_file_path(char *f)
|
||||||
*/
|
*/
|
||||||
int save(int confirm)
|
int save(int confirm)
|
||||||
{
|
{
|
||||||
if(xctx->modified)
|
struct stat buf;
|
||||||
|
char *name = xctx->sch[xctx->currsch];
|
||||||
|
int force = 0;
|
||||||
|
|
||||||
|
if(!stat(name, &buf)) {
|
||||||
|
if(xctx->time_last_modify && xctx->time_last_modify != buf.st_mtime) {
|
||||||
|
force = 1;
|
||||||
|
confirm = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(force || xctx->modified)
|
||||||
{
|
{
|
||||||
if(confirm) {
|
if(confirm) {
|
||||||
tcleval("ask_save");
|
tcleval("ask_save");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue