Geany is smart enough to add phpdoc prefix on line feed. Example:
<?php /** * one two three four|
Press Return.
<?php /** * one two three four * |
So far so good. But that the same trick does not work with paste:
<?php /** * one two three four Lorem ipsum dolor sit amet
whereas I would expect
<?php /** * one two three four Lorem ipsum * dolor sit amet
The comment function does not work in phpdoc either.
Anticipating your answer, I agree that phpdoc syntax is a failure. But that is what I have, and I have to deal with it.
Any thoughts? Chris
2010/12/4 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Geany is smart enough to add phpdoc prefix on line feed. Example:
Well no, it isn't that smart actually, this is a language independent feature that adds the continuation to any line that the lexer has identified as a multiline comment when you press return, its only PHP dependent in as much as the PHP lexer identifies that the current position is within a multiline comment. It also works for C, C++, Java etc.
<?php /** * one two three four|
Press Return.
<?php /** * one two three four * |
So far so good. But that the same trick does not work with paste:
No, because all the text is pasted first then the lexer is run to decide how it should be highlighted. So when the return is pasted it doesn't know that its part of a multiline comment. To make it work, you would have to paste a character, run the lexer, paste a character, run the lexer etc for each character in the paste text which would make it unacceptably slow for large pastes.
<?php /** * one two three four Lorem ipsum dolor sit amet
whereas I would expect
<?php /** * one two three four Lorem ipsum * dolor sit amet
The comment function does not work in phpdoc either.
As above.
Anticipating your answer, I agree that phpdoc syntax is a failure. But that is what I have, and I have to deal with it.
To make this work you would need a version of paste that is language (PHP in your case) specific. You might be able to write a language specific plugin to check pastes or to rescan afterward.
Cheers Lex
Any thoughts? Chris
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Lex Trotman wrote:
So far so good. But that the same trick does not work with paste:
No, because all the text is pasted first then the lexer is run to decide how it should be highlighted. So when the return is pasted it doesn't know that its part of a multiline comment. To make it work, you would have to paste a character, run the lexer, paste a character, run the lexer etc for each character in the paste text which would make it unacceptably slow for large pastes.
Then I suggest adding a "Paste Special" menu command to do just that. Documentation comments are not that long, and the need to fill in the missing prefixes is very distracting.
Can you offer any advice on reformatting paragraphs in this prefixed mode?
Thanks, Chris
2010/12/6 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Lex Trotman wrote:
So far so good. But that the same trick does not work with paste:
No, because all the text is pasted first then the lexer is run to decide how it should be highlighted. So when the return is pasted it doesn't know that its part of a multiline comment. To make it work, you would have to paste a character, run the lexer, paste a character, run the lexer etc for each character in the paste text which would make it unacceptably slow for large pastes.
Then I suggest adding a "Paste Special" menu command to do just that. Documentation comments are not that long, and the need to fill in the missing prefixes is very distracting.
Can you offer any advice on reformatting paragraphs in this prefixed mode?
A version of copy which removes prefixes or indents and a version of paste which adds them back on to match the paste point would be useful for code reformatting, but the variations between languages mean it probably should be provided by plugins tailored for specific languages.
Any such plugins welcome.
Cheers Lex
Thanks, Chris
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany