Wrap text |
Site Admin
|
physical line breaks may screw your scripts/html content completely. Did you know that for example line breaks after <img> tag may add space in the rendered results and it's certainly what you'll not expect.
Editor does it job by formatting text on the fly and show you wrapped lines while it's up to you to change the text. |
||||||||||||
|
|
Yes, I know that. It would mainly be used to wrap pure text blocks and comment blocks in code. I don't like soft line breaks personally. This kind of wrapping would be used to re-adjust such text blocks after editing has changed the line lengths. It is available in other editors and I find it very useful. Now, if PHPEd had a proper scripting interface, I could probably implement it myself |
||||||||||||||
|
Site Admin
|
I'm not sure what kind of soft or hard breaks you're talking about. PhpED for sure does never insert any of them Its wrap engine is between source code and painting context and does wrap on the fly without modifying anything.
I agree that with a scripted editor you could do what you want to do, but it might slowdown everything. Is it an adequite price for this feature? Are you going to process whole the text when a little bit of it has changed? To me a kind of formatter that could be called with a shortcut does look better and it's what you can do right now. See howto-use-a-php-script-for-my-editing-t753.html for the details |
||||||||||||
|
|
Yes, yes, thats what I mean by soft line breaks. Wrap to window or whatever you want to call it.
I think you misunderstand - I don't mean the editor should do this dynamically. It should be a command that can be invoked by the user when needed. I know Emacs has a special mode where it will do this on-the-fly, but that is a bit dodgy.
Well, that is exactly what I mean. Only that there is no way to extend the selection to the current text block in the way I described in the OP without a real scripting API. But it is certainly possible to write a script that works on the selection as it is now. Perhaps not in PHP, though. I'll have a look at what can be done. |
||||||||||||||||||
|
|
I just tested to make a PHP script working on the current selection as described in the FAQ linked from the previous post.
I have some issued with that though. I'm using PHP5. Here's a minimal test script:
This doesn't work though. The str_replace is there because the text has a strange encoding with every character separated by a NUL-character. It isn't proper UTF16 though. The length of the text is just half of what it should be so only half of the text is echoed back. I am not sure if this is PHPEd or PHP acting up, but whatever it is, it makes it impossible to write this kind of scripts. |
||||||||||||||
|
Site Admin
|
Ok, seems like we have an issue there. It should be UTF-8, nothing else.
|
||||||||||||
|
Site Admin
|
it's fixed in build 4512 (will come soon)
|
||||||||||||
|
Wrap text |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by