Hi all,
Had a minor niggle which i decided to fix. If I do:
geany some_file_which_doesn't_exist
geany will open a new tab with the right file name for the tab. If I then add some code/text and try to save the file, geany currently throws up a SaveAs dialog box even though it was already given a filename earlier.
The attached patch fixes this (tested on Linux) by changing the needs_save_as logic to ignore doc->real_path and only check doc->file_name.
Cheers, Erik
Hi Erik,
How does this work with geany some_dir_that_doesn't_exist/some_file_that_doesn't_exist?
IIUC the check of real path is to catch missing directories and let the user choose what to do
Cheers Lex
On 12 August 2010 14:01, Erik de Castro Lopo mle+tools@mega-nerd.com wrote:
Hi all,
Had a minor niggle which i decided to fix. If I do:
geany some_file_which_doesn't_exist
geany will open a new tab with the right file name for the tab. If I then add some code/text and try to save the file, geany currently throws up a SaveAs dialog box even though it was already given a filename earlier.
The attached patch fixes this (tested on Linux) by changing the needs_save_as logic to ignore doc->real_path and only check doc->file_name.
Cheers, Erik
--
Erik de Castro Lopo http://www.mega-nerd.com/
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Lex Trotman wrote:
How does this work with geany some_dir_that_doesn't_exist/some_file_that_doesn't_exist?
Well it doesn't crash or do the wrong thing :-). Instead it puts up a dialog box saying "Error saving file. No such file or directory". The user can then choose to do SaveAs and save it to an directory that does exist.
IIUC the check of real path is to catch missing directories and let the user choose what to do
That may be so, but the pre-patch behaviour of the asking for a SaveAs path even when a valid path was specified previously is just annoying.
Erik
On 12 August 2010 23:03, Erik de Castro Lopo mle+tools@mega-nerd.com wrote:
Lex Trotman wrote:
How does this work with geany some_dir_that_doesn't_exist/some_file_that_doesn't_exist?
Well it doesn't crash or do the wrong thing :-). Instead it puts up a dialog box saying "Error saving file. No such file or directory". The user can then choose to do SaveAs and save it to an directory that does exist.
I guess thats a reasonable response to the situation :-)
IIUC the check of real path is to catch missing directories and let the user choose what to do
That may be so, but the pre-patch behaviour of the asking for a SaveAs path even when a valid path was specified previously is just annoying.
I suppose so, I got over the command line back in the eighties & now tend to do things from the GUI. :-D
Sorry, I've still got this nagging suspicion that the there was a discussion a while back of some problem that the realpath check guarded, but I can't find it now of course :-( So unless someone else finds it in the mailing list past or remembers it I guess its ok.
Cheers Lex
Erik
Erik de Castro Lopo http://www.mega-nerd.com/ _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Erik de Castro Lopo wrote:
Had a minor niggle which i decided to fix. If I do:
geany some_file_which_doesn't_exist
geany will open a new tab with the right file name for the tab. If I then add some code/text and try to save the file, geany currently throws up a SaveAs dialog box even though it was already given a filename earlier.
The attached patch fixes this (tested on Linux) by changing the needs_save_as logic to ignore doc->real_path and only check doc->file_name.
Any decision on whether this patch is going to be applied?
Erik
On Thu, 9 Sep 2010 19:57:07 +1000 Erik de Castro Lopo mle+tools@mega-nerd.com wrote:
Had a minor niggle which i decided to fix. If I do:
geany some_file_which_doesn't_exist
geany will open a new tab with the right file name for the tab. If I then add some code/text and try to save the file, geany currently throws up a SaveAs dialog box even though it was already given a filename earlier.
The attached patch fixes this (tested on Linux) by changing the needs_save_as logic to ignore doc->real_path and only check doc->file_name.
Any decision on whether this patch is going to be applied?
I did some research into why real_path was checked - it's for file templates so the user can choose a filename.
I committed a change so an absolute path is necessary to avoid prompting the user - so your command-line new file should now work as expected.
Regards, Nick
Nick Treleaven wrote:
I did some research into why real_path was checked - it's for file templates so the user can choose a filename.
I committed a change so an absolute path is necessary to avoid prompting the user - so your command-line new file should now work as expected.
Great. Thanks.
Erik