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.

1
  • I cannot reproduce your problem.
    – Dan
    May 12, 2015 at 11:00

2 Answers 2

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.

1
  • I found the problem was company mode, with idle-delay 0. It fixed it.
    – DalekSall
    May 12, 2015 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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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