Loading ...
Sorry, an error occurred while loading the content.

Bug: Macro not recorded on server for commands sent via client/server protocol

Expand Messages
  • Mislav Marohnić
    I m controlling a macvim instance (the server ) from command-line by issuing commands via `vim --remote-send` (the client ). Everything seems to work except
    Message 1 of 6 , Nov 30, 2011
    • 0 Attachment
      I'm controlling a macvim instance (the "server") from command-line by issuing commands via `vim --remote-send` (the "client").

      Everything seems to work except recording macros. For instance, I send this command: "qa2hrXq"

      This is supposed to record a macro in register "a" that moves the cursor 2 characters left and replaces the current character with "X". Simple enough, and when I send this via the client, the server runs the commands (when the macro is being recorded, the status bar of the server even says "--recording--").

      BUT, the server doesn't record the macro into register "a". When switch to the server and issue "@a" there, nothing happens. When I look at the output of ":registers" command, register "a" is listed but is empty. When I record the same macro on the server, register "a" gets filled in and "@a" works.

      Reproducible always. MacVim 7.3 (2010 Aug 15) p1-353

      Although MacVim has its own implementation of client/server protocol, MacVim maintainer says this looks like a core issue: http://code.google.com/p/macvim/issues/detail?id=391

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Mislav Marohnić
      ... This hasn t got enough attention. Can anyone please just check on their linux-/windows-compiled vim if they can reproduce it? The issue is that macros
      Message 2 of 6 , Dec 2, 2011
      • 0 Attachment
        On Wednesday, November 30, 2011 10:59:36 AM UTC+1, Mislav Marohnić wrote:
        I'm controlling a macvim instance (the "server") from command-line by issuing commands via `vim --remote-send` (the "client").

        Everything seems to work except recording macros. For instance, I send this command: "qa2hrXq"

        This hasn't got enough attention. Can anyone please just check on their linux-/windows-compiled vim if they can reproduce it? The issue is that macros don't get recorded if commands are sent over client/server protocol.

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Jürgen Krämer
        Hi, ... confirmed for GVim 7.3.363 on Windows 7. Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe
        Message 3 of 6 , Dec 2, 2011
        • 0 Attachment
          Hi,

          Mislav Marohnić wrote:
          >
          > I'm controlling a macvim instance (the "server") from command-line by
          > issuing commands via `vim --remote-send` (the "client").
          >
          > Everything seems to work except recording macros. For instance, I send
          > this command: "qa2hrXq"
          >
          > This is supposed to record a macro in register "a" that moves the
          > cursor 2 characters left and replaces the current character with "X".
          > Simple enough, and when I send this via the client, the server runs
          > the commands (when the macro is being recorded, the status bar of the
          > server even says "--recording--").
          >
          > BUT, the server doesn't record the macro into register "a". When
          > switch to the server and issue "@a" there, nothing happens. When I
          > look at the output of ":registers" command, register "a" is listed but
          > is empty. When I record the same macro on the server, register "a"
          > gets filled in and "@a" works.
          >
          > Reproducible always. MacVim 7.3 (2010 Aug 15) p1-353

          confirmed for GVim 7.3.363 on Windows 7.

          Regards,
          Jürgen

          --
          Sometimes I think the surest sign that intelligent life exists elsewhere
          in the universe is that none of it has tried to contact us. (Calvin)

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Andy Wokula
          ... (same here with gVim on win32) I m not sure what the reason is. But macro recording is a special case, you can t do it from a mapping ... or from
          Message 4 of 6 , Dec 2, 2011
          • 0 Attachment
            Am 02.12.2011 15:20, schrieb Mislav Marohnić:
            > On Wednesday, November 30, 2011 10:59:36 AM UTC+1, Mislav Marohnić wrote:
            >>
            >> I'm controlling a macvim instance (the "server") from command-line by
            >> issuing commands via `vim --remote-send` (the "client").
            >>
            >> Everything seems to work except recording macros. For instance, I send
            >> this command: "qa2hrXq"
            >>
            >
            > This hasn't got enough attention. Can anyone please just check on their
            > linux-/windows-compiled vim if they can reproduce it? The issue is that
            > macros don't get recorded if commands are sent over client/server protocol.

            (same here with gVim on win32)

            I'm not sure what the reason is.

            But macro recording is a special case, you can't do it from a mapping
            :map g7 qa1Gq

            or from feedkeys()
            :call feedkeys('qa1Gq')

            (unless 't' is given -- process keys as if typed by the user)
            :call feedkeys('qa1Gq', 't')

            or while recording a macro.
            qbqa...

            I think keys from a remote Vim are processed "as if coming from a mapping"
            (remote_send() even understands key codes etc).

            --
            Andy

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Mislav Marohnić
            Andy, thanks a ton for letting me know about feedkeys(..., t ). I ve switched my --remote-send calls to --remote-expr that calls feedkeys() and now macros
            Message 5 of 6 , Dec 5, 2011
            • 0 Attachment
              Andy, thanks a ton for letting me know about feedkeys(..., 't').

              I've switched my "--remote-send" calls to "--remote-expr" that calls feedkeys() and now macros are properly recorded.

              However I still think it's a bug that "--remote-send" processes input "as if coming from a mapping", as you said Andy. I've managed to work around my problem, but this should definitely be fixed in vim.

              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Ben Fritz
              ... Maybe. But it sounds like it s intentional. As Andy says, ... IIUC, this means you can send things like: Ibegin A end to surround the
              Message 6 of 6 , Dec 5, 2011
              • 0 Attachment
                On Dec 5, 8:57 am, Mislav Marohnić <mislav.maroh...@...> wrote:
                > Andy, thanks a ton for letting me know about feedkeys(..., 't').
                >
                > I've switched my "--remote-send" calls to "--remote-expr" that calls
                > feedkeys() and now macros are properly recorded.
                >
                > However I still think it's a bug that "--remote-send" processes input "as
                > if coming from a mapping", as you said Andy. I've managed to work around my
                > problem, but this should definitely be fixed in vim.

                Maybe. But it sounds like it's intentional. As Andy says,

                > I think keys from a remote Vim are processed "as if coming from a mapping"
                > (remote_send() even understands key codes etc).

                IIUC, this means you can send things like:

                <Esc>Ibegin<CR><Esc>A<CR>end<Esc>

                to surround the current line in begin...end in a remote Vim.

                But I've never had reason to try using remote_send for anything, so I
                could be mistaken. The :help for --remote-send seems to support this,
                at least.

                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              Your message has been successfully submitted and would be delivered to recipients shortly.