Inserted snippet via callword kills newline char after it

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Inserted snippet via callword kills newline char after it

Post by EvilBMP »

Hi,

i have encountered a problem with the snippet library. If you insert a snippet via callword (and pressing Ctrl + J) then the inserted snippet kills the newline char after the last char of the snippet.

For example (pipe symbolises the cursor):

Code: Select all

<?php

    function foo() {
        function bar() {
            |
        }
    }

?>
Now I insert some callword and press Ctrl+J, I get:

Code: Select all

<?php

    function foo() {
        function bar() {
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                '|',
                '',
                '',
                '',
                '',
                ''
            );        }
    }

?>
The newline after the snippet is killed and the curly bracket is behind the last char of the snippet (including indent).

Well, and it doesn't help if you insert a newline after the snippet in the snippet library!

That is the bug ... now a question. Is it possible to change the Ctrl+J shortcut? I didn't find it in the "Keyboard shortcuts..." settings.

Thx, EvilBMP
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: Inserted snippet via callword kills newline char after it

Post by Karlis »

Ctrl+J can not be changed. Does adding multiple newlines at the end of the snippet help?
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Re: Inserted snippet via callword kills newline char after it

Post by EvilBMP »

Karlis wrote:Ctrl+J can not be changed.
:cry:
Karlis wrote:Does adding multiple newlines at the end of the snippet help?
Yes, with 3 newlines after the last char it works as expected! BUT ... if you use TABs to indent some code of a multiline snippet, I detected the same bug as mentioned right :arrow: here (Constrain cursor to text disabled)

Using spaces to indent code in a multiline snippet, than everything works perfect (no cursor bug then, as in linked topic).
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Re: Inserted snippet via callword kills newline char after it

Post by syrupcore »

EvilBMP wrote:
Karlis wrote:Ctrl+J can not be changed.
:cry:
adding my own tears... :cry:
Post Reply