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

Bug in url handler?

Expand Messages
  • SirVer
    Hi, if I try this on the console $ open mvim://open?url=file:///etc/profile&line=20 a new MacVim opens with an empty buffer [No Name] . if I do this again
    Message 1 of 9 , Jan 29, 2009
    • 0 Attachment
      Hi,

      if I try this on the console

      $ open 'mvim://open?url=file:///etc/profile&line=20'

      a new MacVim opens with an empty buffer '[No Name]'.

      if I do this again on the console:

      $ open 'mvim://open?url=file:///etc/profile&line=20'

      the profile file opens on line 20 as expected. I think there is a bug
      lurking here somewhere.

      I'm using Snapshot 42, Intel iMac with Leopard.

      Greetings,
      Holger

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Nico Weber
      Hi, ... Works for me on the first try (was MacVim running but no windows opened, or was MacVim not running at all? I can t close my MacVim right now to try
      Message 2 of 9 , Jan 29, 2009
      • 0 Attachment
        Hi,

        On 29.01.2009, at 01:32, SirVer wrote:

        > if I try this on the console
        >
        > $ open 'mvim://open?url=file:///etc/profile&line=20'
        >
        > a new MacVim opens with an empty buffer '[No Name]'.
        >
        > if I do this again on the console:
        >
        > $ open 'mvim://open?url=file:///etc/profile&line=20'
        >
        > the profile file opens on line 20 as expected. I think there is a bug
        > lurking here somewhere.

        Works for me on the first try (was MacVim running but no windows
        opened, or was MacVim not running at all? I can't close my MacVim
        right now to try :-P).

        Does it work if you put the URL in the Safari URL bar?

        If you just want to open a file with MacVim, you can use `open -a
        MacVim /etc/profile` (or the mvim script) instead. I didn't know you
        can open URLs with open, so I didn't test that back then.

        Nico

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Holger Rapp
        Hi, ... MacVim was open. But I can reproduce it now in this way - Close MacVIM (cmd+q) - enter mvim://open?url=file:///etc/profile&line=20 in a newly opened
        Message 3 of 9 , Jan 30, 2009
        • 0 Attachment
          Hi,

          if I try this on the console

          $ open 'mvim://open?url=file:///etc/profile&line=20'

          a new MacVim opens with an empty buffer '[No Name]'.

          if I do this again on the console:

          $ open 'mvim://open?url=file:///etc/profile&line=20'

          the profile file opens on line 20 as expected. I think there is a bug
          lurking here somewhere.

          Works for me on the first try (was MacVim running but no windows
          opened, or was MacVim not running at all? I can't close my MacVim
          right now to try :-P).
          MacVim was open. But I can reproduce it now in this way
          - Close MacVIM (cmd+q)
          - enter mvim://open?url=file:///etc/profile&line=20 in a newly opened safari window
          - a new MacVim window opens without any file opened (Bild1.png)
          - pressing enter again in the safari location text entry
          - in the MacVim Window, /etc/profile is opened (Bild2.png)

          I can also use open on the cmdline, it doesn't change a thing.

          If you just want to open a file with MacVim, you can use `open -a
          MacVim /etc/profile` (or the mvim script) instead. I didn't know you
          can open URLs with open, so I didn't test that back then.
          Year, I know. I want to write a script that takes TODOs from my code and enters them into OmniFocus so
          I do not have to keep track of them manually. I want to add a link to the notebox which directly takes the use to the
          file in macvim, therefore i need the line= option.

          Greetings,
          Holger

        • björn
          ... I ll look into this bug, but can t you just use the command line parameter +num instead? For example: mvim /etc/profile +20 Ok, so this only works with
          Message 4 of 9 , Jan 30, 2009
          • 0 Attachment
            2009/1/30 Holger Rapp:
            >
            > MacVim was open. But I can reproduce it now in this way
            > - Close MacVIM (cmd+q)
            > - enter mvim://open?url=file:///etc/profile&line=20 in a newly opened safari
            > window
            > - a new MacVim window opens without any file opened (Bild1.png)
            > - pressing enter again in the safari location text entry
            > - in the MacVim Window, /etc/profile is opened (Bild2.png)
            >
            > I can also use open on the cmdline, it doesn't change a thing.
            >
            > If you just want to open a file with MacVim, you can use `open -a
            >
            > MacVim /etc/profile` (or the mvim script) instead. I didn't know you
            >
            > can open URLs with open, so I didn't test that back then.
            >
            > Year, I know. I want to write a script that takes TODOs from my code and
            > enters them into OmniFocus so
            > I do not have to keep track of them manually. I want to add a link to the
            > notebox which directly takes the use to the
            > file in macvim, therefore i need the line= option.

            I'll look into this bug, but can't you just use the command line
            parameter "+num" instead? For example:

            mvim /etc/profile +20

            Ok, so this only works with the 'mvim' script installed, and perhaps
            that was your reason for using the "mvim://" handler instead?

            Björn

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_mac" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Holger Rapp
            Hi Björn, ... unfortunately not. I can change the note in OmniFocus by Applescript (or actually by a python apple event script called appscript which rocks so
            Message 5 of 9 , Jan 30, 2009
            • 0 Attachment
              Hi Björn,

              >>
              >> Year, I know. I want to write a script that takes TODOs from my
              >> code and
              >> enters them into OmniFocus so
              >> I do not have to keep track of them manually. I want to add a link
              >> to the
              >> notebox which directly takes the use to the
              >> file in macvim, therefore i need the line= option.
              >
              > I'll look into this bug, but can't you just use the command line
              > parameter "+num" instead? For example:
              >
              > mvim /etc/profile +20
              unfortunately not. I can change the note in OmniFocus by Applescript
              (or actually by a python apple event script called appscript which
              rocks so hard i can hardly describe it :) ). And OmniFocus turns urls
              into clickable items. I am not aware of a possibility to use urls to
              launch a script with arguments. Are there any?

              Thanks for the reply!
              Holger



              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_mac" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • björn
              ... I don t know of any way. It struck me though that the problem you are seeing may be the same bug as in Issue 130:
              Message 6 of 9 , Feb 1, 2009
              • 0 Attachment
                2009/1/30 Holger Rapp:
                >
                >> I'll look into this bug, but can't you just use the command line
                >> parameter "+num" instead? For example:
                >>
                >> mvim /etc/profile +20
                > unfortunately not. I can change the note in OmniFocus by Applescript
                > (or actually by a python apple event script called appscript which
                > rocks so hard i can hardly describe it :) ). And OmniFocus turns urls
                > into clickable items. I am not aware of a possibility to use urls to
                > launch a script with arguments. Are there any?

                I don't know of any way.

                It struck me though that the problem you are seeing may be the same
                bug as in Issue 130:

                http://code.google.com/p/macvim/issues/detail?id=130

                The question is: do you set 'viminfo' to contain "%" in your [g]vimrc?
                If so, then that is most likely the problem. If not, you should
                still try to move your [g]vimrc and .vim folder out of the way and
                restart. Does the problem persist?

                Björn

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_mac" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Ben Schmidt
                ... I hope there aren t, because that would introduce all kinds of security problems. Ben. --~--~---------~--~----~------------~-------~--~----~ You received
                Message 7 of 9 , Feb 1, 2009
                • 0 Attachment
                  >> I am not aware of a possibility to use urls to
                  >> launch a script with arguments. Are there any?
                  >
                  > I don't know of any way.

                  I hope there aren't, because that would introduce all kinds of security
                  problems.

                  Ben.




                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_mac" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Holger Rapp
                  Hi, ... This solved the issue for me. I removed % from my viminfo line and things work like a charm. I do not need the bufferlist restored anyway since i work
                  Message 8 of 9 , Feb 2, 2009
                  • 0 Attachment
                    Hi,

                    > It struck me though that the problem you are seeing may be the same
                    > bug as in Issue 130:
                    >
                    > http://code.google.com/p/macvim/issues/detail?id=130
                    >
                    > The question is: do you set 'viminfo' to contain "%" in your [g]vimrc?
                    > If so, then that is most likely the problem. If not, you should
                    > still try to move your [g]vimrc and .vim folder out of the way and
                    > restart. Does the problem persist?
                    This solved the issue for me. I removed % from my viminfo line and
                    things work
                    like a charm. I do not need the bufferlist restored anyway since i
                    work with
                    sessionfiles.

                    Thanks for the help ;)
                    Keep up the good work on MacVim; it is the best implementation of vim
                    out there!

                    Greetings,
                    Holger



                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_mac" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • björn
                    ... Good! I know exactly where the bug is but I have yet to come up with a _good_ way to fix it, but I ll most likely have it fixed before the next snapshot.
                    Message 9 of 9 , Feb 2, 2009
                    • 0 Attachment
                      2009/2/2 Holger Rapp:
                      >
                      >> The question is: do you set 'viminfo' to contain "%" in your [g]vimrc?
                      >> If so, then that is most likely the problem. If not, you should
                      >> still try to move your [g]vimrc and .vim folder out of the way and
                      >> restart. Does the problem persist?
                      > This solved the issue for me. I removed % from my viminfo line and
                      > things work
                      > like a charm. I do not need the bufferlist restored anyway since i
                      > work with
                      > sessionfiles.

                      Good! I know exactly where the bug is but I have yet to come up with
                      a _good_ way to fix it, but I'll most likely have it fixed before the
                      next snapshot.

                      Björn

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_mac" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    Your message has been successfully submitted and would be delivered to recipients shortly.