Share

Scintilla

Tracker: Bugs

2 One file, two buffers, second one keeps asking for reload - ID: 1970403
Last Update: Settings changed ( nyamatongwe )

Scenario
--------
1) PC with Windows XP Professional.
2) SciTE with:

load.on.activate=1

in its config file.

Test
----
1) create two new buffers and write some text on each of them;
2) save the second buffer to a file;
3) save the first buffer to the same file of the first.

(save order is important to reproduce this problem)

Now you have two buffers open for the same file and the problem is that
when you go to the second buffer you are notified that the file has been
changed and that it must be reloaded, if you say "yes" the focus is moved
to the first buffer that is also reloaded.

This happens whenever you try to go to the second buffer.

You are able to access the second buffer by answering "no" when you are
asked whether you want to reload the file or not.


Danilo Turina ( daniloturina ) - 2008-05-23 12:42

2

Closed

Fixed

Neil Hodgson

SciTE

Bug

Public


Comments ( 7 )




Date: 2008-07-06 07:23
Sender: nyamatongweProject Admin


Committed a change that should prevent a buffer from being saved to the
same file as another buffer.


Date: 2008-05-26 10:19
Sender: nyamatongweProject Admin


This works differently on Windows so the patch only works for GTK+. If I
get time, I'll look into making it work on Windows.


Date: 2008-05-24 13:55
Sender: daniloturina


Sorry, forgot to tell that I wrote the patch on the source code of SciTE
1.76


Date: 2008-05-24 13:51
Sender: daniloturina


You can find a patch attached to this comment.
A few notes about the patch:

1) while there where multiple choices ([a] closing the current buffer
and switching to the one that already have the chosen filename, [b]
preventing the action at all, [c] alerting the user and letting him
continue if he wants, etc.) with different flavors (with or without alert
to the user, configurable or not behavior, etc.), I choose a very simple
solution: preventing the save as with same filename of another buffer at
all;

2) I don't have a an adeguate development environment in my PC for
compiling and, thus, testing the patch: the patch has not been compiled nor
tested;

3) you are right about "a rarely occurring problem", so if you don't
want to lose time with this patch and/or you don't include it in SciTE,
I'll understand it.

File Added: scintilla-Bugs-1970403.patch


Date: 2008-05-24 08:54
Sender: nyamatongweProject Admin


Disallowing saving to the same file as a current buffer would be my
preference too but its extra work for a rarely occurring problem. I'll
accept a patch.


Date: 2008-05-24 07:09
Sender: daniloturina


I understand the design choice of SciTE (and I agree too: the test case
came from a real world situation in which I, by mistake, performed a "save
as" on two different buffers to the same file).

Anyway, the problem that I had with this "bug" was not that I had two
buffers for the same file and it wasn't handled correctly but, instead,
that I, by mistake, had the same file opened in two different buffers and
SciTE didn't prevent me to do it, instead it allowed me to do it and, then,
it didn't work properly with those two buffers.

Isn't it possible to explicitly disallow that a file is opened in two
different buffers using the "save as" command (at least for those cases in
which it's trivial to determine that two pathnames refers to the same
file)? Or maybe this would disallow other useful scenarios?



Date: 2008-05-23 22:33
Sender: nyamatongweProject Admin


SciTE wasn't designed to allow having the same file opened multiple times.
While it would be slightly better to stay on the same buffer, I don't want
to support multiple buffers on the same file.



Log in to comment.




Attached File ( 1 )

Filename Description Download
scintilla-Bugs-1970403.patch Download

Changes ( 7 )

Field Old Value Date By
close_date - 2008-10-22 08:26 nyamatongwe
status_id Open 2008-10-22 08:26 nyamatongwe
resolution_id Wont Fix 2008-07-06 07:23 nyamatongwe
File Added 278891: scintilla-Bugs-1970403.patch 2008-05-24 13:51 daniloturina
resolution_id None 2008-05-23 22:33 nyamatongwe
assigned_to nobody 2008-05-23 22:33 nyamatongwe
priority 5 2008-05-23 22:33 nyamatongwe