Bugs item #1907176, was opened at 2008-03-04 09:36
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1907176&group_id=11005

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tony Balinski (ajbj)
Assigned to: Nobody/Anonymous (nobody)
Summary: Empty $file_path

Initial Comment:
When you start NEdit without a particular file, you get a document labelled 
"Unknown". It is created without a file path, which can be a big problem if you 
execute macros from it using $file_name.

This is easy to fix in function EditNewFile() in file.c, where window->path is 
assigned:

strcpy(window->path, defaultPath ? defaultPath : "");

Instead of "", call GetCurrentDir() (in util/utils.c).
On Unix/Linux/Posix/Cygwin you'll need to add a "/" to that, since that's how 
file paths are normally terminated in NEdit. (On VMS, I expect this is not 
necessary, but I don't have such a system to play with. I don't know about 
other file path conventions on other systems.)

Having made the change results in a correctly assigned $file_path value for 
these documents. This path is visible in the statistics line (if you use that), 
another useful feature.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2008-03-11 11:16

Message:
Logged In: NO 

My key is:

1) should a "untitled" file have a path?

2)If you think it should, then apply the mentioned fix and make the same
path can ALSO be seen on the window title. 

3)If you think it shouldn't, then we can think about another fix and keep
the concept that an "unititled" file doesn't have a path as it is not a
real file.

You can choose either 2 or 3, but you can't mix them!

As far as that you mentioned an "untitled" file has a (strange) path
attached (with the current nedit), this is a bug and we should fix it.




----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-03-11 10:41

Message:
Logged In: YES 
user_id=122956
Originator: NO

It is currently possible to have an Untitled document/tab which have a
path attached. so this bug closes only a gap, that not all Untitled
documents have a path attached.

If you don't know this: start NEdit with an file argument, be sure you see
the stats line, than open a new tab, you will see that this new untitled
tab has a path attached.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2008-03-11 10:34

Message:
Logged In: NO 

I think maybe it is better to have a more complicated fix other than
breaking the logicality and consistency with a simple fix.

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-03-11 10:21

Message:
Logged In: YES 
user_id=122956
Originator: NO

Than feel free to open a new bug report. this bug affects only the first
Untitled document, if you start NEdit without a given file name. New
Untitled documents if other files are open, has already a path attached.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2008-03-11 10:12

Message:
Logged In: NO 

I think logically if there is a path, and if it can be shown in the
statistics line, why can't it be shown on the title?

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-03-11 09:23

Message:
Logged In: YES 
user_id=122956
Originator: NO

The path in the window is not shown, because an Untitled document has no
real filename and NEdit prevents than to show the path.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2008-03-11 07:49

Message:
Logged In: NO 

By calling GetCurrentDir() you can have the path visible in the statistics
line but not in the window title (even if you choose to show it).

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-03-04 10:19

Message:
Logged In: YES 
user_id=122956
Originator: NO

Great, I noticed this too, while we both discuss your
relativeFileNormalization patch, but haven't time to look at this. Thanks.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1907176&group_id=11005
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to