Posted 10 years ago by JMan
Version: 2.1.12
Avatar

The Python file at this link (https://drive.google.com/file/d/0B5RbdaTMkQlkaTU5U2ZSVktXVHc/edit?usp=sharing) does not save correctly. The last line (that is displayed in the editor):

print(repr(results[print_what]) if print_what != 5 else results[print_what])

 is saved as (on disk):

print(repr(results[print_what]) if print_what != 5 else results[print_what])_what])

This is happening on Windows 8.1 for my machine. 

[Modified 10 years ago]

Comments (14)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, when I opened that file in Visual Studio, its contents were what you said was saved on disk (which seemed wrong since I would have expected it to be the original file).  I removed the extra characters, saved it, then ran Code Writer and opened it.  I saved it and it did not add the extra characters.  I can't think of anything that would cause that sort of behavior other than if you accidentally had those contents to start with?


Actipro Software Support

Posted 10 years ago by JMan
Avatar

When I open the file in Code Writer, remove the extra characters, and then save the file, the extra characters are added back. It doesn't add characters if I remove the characters in Notepad++. The problem starts again if I add "_what])" in Code Writer, then save, then remove those characters and save again.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, I'm not really sure how that could happen since we save what is visible on screen directly out to the file.  Are you using any different encodings or anything?  I wasn't able to reproduce it at all.  Can anyone else reproduce this?


Actipro Software Support

Posted 10 years ago by JMan
Avatar

I save all files as UTF-8 with Windows line endings.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Those are the same settings I use as well when testing.  I tried a couple more times and still cannot get it to occur.  If any other users reading this tries, please let us know the results you get as well.  Thanks!


Actipro Software Support

Posted 10 years ago by Thomas Bonde
Avatar

I know this entry is old. But im experiencing similar problems:

Hi,

I love the concept of your Code Writer. However, there are some major bugs, that prevents me from using this as my daily driver.

1. The Automatic encoding detection doesnt work. If i create a new file, i can Save as, but repeated Saves report access denied. I fixed this by specificing a particular encoding time (UTF-8 in my case). That fixed the problem.

2. A major problem i cant fix is that when i save it sometimes "duplicates" parts of the text. For instance a simple code like this:

<!DOCTYPE html>


<html>
	<head>
		<title>Page Title</title>
		<script language="javascript" src="control.js"></script>
		
		<style>
			[mType="1"]{
				width: 800px;
				position: relative;
				border: 1px solid #C0C0C0;
			}
		</style>
	</head>
	<body onload="order_tiles()">
		<div mType="1">
			<div mType="2">asd</div>
			<div mType="2">asd</div>
			<div mType="2">asd</div>
			<div mType="2">asd</div>
		</div>
	</body>
</html>

It turns into following when saved:

<!DOCTYPE html>


<html>
	<head>
		<title>Page Title</title>
		<script language="javascript" src="control.js"></script>
		
		<style>
			[mType="1"]{
				width: 800px;
				position: relative;
				border: 1px solid #C0C0C0;
			}
		</style>
	</head>
	<body onload="order_tiles()">
		<div mType="1">
			<div mType="2">asd</div>
			<div mType="2">asd</div>
			<div mType="2">asd</div>
			<div mType="2">asd</div>
		</div>
	</body>
</html>
			<div mType="2">asd</div>
			<div mType="2">asd</div>
			<div mType="2">asd</div>
			<div mType="2">asd</div>
		</div>
	</body>
</html>

 

If you fix this, im 100% a fulltime user of this app. Its the best coding app in the app store for sure!

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Thomas,

Thanks for writing.

1) Can you give more information on this?  Are you able to reliably reproduce this with certain steps that we can follow?

2) We have had a couple other reports of similar things where the file contents are duplicated somehow but so far have not been able to reproduce it.  Our file save code is very straightforward and couldn't be any simpler, so I'm not sure how this could even happen other than if two asynchronous save operations are somehow overwriting each other.  But I would think that there would be a write lock on the file while the other operation was running.

Are you able to provide any more detail about how to make this scenario occur?


Actipro Software Support

Posted 10 years ago by Thomas Bonde
Avatar

Hi again,

So i have tested a bit and i think i can reliably reproduce the error (at least on my own machine).

First i thought it was because i was writing the file directly through WebDAV, but the same thing happens when i write the file directly to the desktop. Follow these instructions:

1. Open Code Writer
2. Create new PHP file
3. Save file as test.php. Saved with default text produced by "Code Writer" - Output is correct. Example follows:

<html>
<head>
	<title>Page Title</title>
</head>
<body>



</body>
</html>

4. Now, Delete linebreaks between <body> and </body> - Save it. Output is wrong. Example follows:

<html>
<head>
	<title>Page Title</title>
</head>
<body>
</body>
</html>
tml>

 For some reason "tml>" is added. And the amount of extra text varies dependant on how much text is written. I cant reliably replicate it with longer texts. Sometimes i can save 20 times without a hitch, other times only a couple of times.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Thomas,

Quick question... I've been trying unsuccessfully to reproduce it but then finally got it to happen when I picked a custom encoding.  Are you using any Character Encodings (set in the Settings / Editor pane)?


Actipro Software Support

Posted 10 years ago by Thomas Bonde
Avatar

Yes. I have it set to UTF-8 (Codepage 65001).

Posted 10 years ago by Thomas Bonde
Avatar

I have custom encoding because i was receiving "Access Denied" when using Automatic Detection and repeatably saving the document. I cant, however, reproduce it reliably.

Answer - Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Thomas,

Yes I think we've finally got this sorted out.  An alternate file save method occurs when character encodings are used and in that case, if the document being saved is smaller than the file, it wasn't completely clearing the old contents.  We made a change to fix this bug for the next version, which we'll try and get out soon!


Actipro Software Support

Posted 10 years ago by Thomas Bonde
Avatar

Thanks a lot :-)

Cant wait to use this as my daily driver!

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thomas,

Also for your first reported issue with the "Access Denied" when using automatic detection for character encoding, we haven't seen that happen.  The code we call to save a file in that scenario is a simple one line built-in method provided by Microsoft too:

await FileIO.WriteTextAsync(storageFile, text);

I would think that it should work reliably since code doesn't come any simpler than that. :)  Are you able to reproduce it easier when saving to one type of target drive (like SkyDrive vs. your desktop) than another?


Actipro Software Support

The latest build of this product (v4.2.42) was released 3 years ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.