2

I'm trying to achieve the following with this:

$pricelist = pricelist();
$hotels[$index ]['id']

I want to copy the bottom line into the pricelist() function like this:

$pricelist = pricelist($hotels[$index ]['id']);

I'm selecting the bottom line text only in visual mode, and yanking it, then when I go to the first parenthesis it pastes the line below, but with the last square bracket moved like so:

     $pricelist = pricelist();
]$hotels[$index ]['id

Can anyone explain what I am doing wrong?

Apparently I can't paste anything into the parentheses, it puts it on the line below.

  • I cannot reproduce your problem. – Dan May 12 '15 at 11:00
0

I can reproduce the fact to not copy anything in the parenthesis but not the brocken braket.

It pastes on the line below if you copy the new line character, so if you copy the whole line. There's two ways to copy in the parenthesis:

  • go in insert mode inside the parenthesis and paste with C-y
  • copy the whole line in visual mode (and not visual mode line), i.e. with v$y and copy in normal mode with p inside the parenthesis.

Another way: give 0 as prefix argument for kill-whole-line with C-u 0. This doesn't copy the trailing newline character. This function is bound to C-S backspace.

  • I found the problem was company mode, with idle-delay 0. It fixed it. – DalekSall May 12 '15 at 11:11
0

Found the problem. I had this in my .emacs:

(setq company-idle-delay 0)

I have no set it to 1 and i have no problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.