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

argisglobal patch

Expand Messages
  • Marcin Szamotulski
    Hello, I wrote a small patch which adds argisglobal() function which returns 1 if the current buffer has global arglist otherwise, if there is a local arg list
    Message 1 of 6 , Feb 3, 2014
    • 0 Attachment
      Hello,

      I wrote a small patch which adds argisglobal() function which returns
      1 if the current buffer has global arglist otherwise, if there is
      a local arg list it return 0. I haven't found any other way to test if
      the arglist is gobal/local.

      I've been using this patch for some time already (I have a plugin
      http://www.vim.org/scripts/script.php?script_id=4681 which is using it)
      and it works fine.

      Best regards,
      Marcin Szamotulski

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Marcin Szamotulski
      ... and here is the patch which I ve forgotten to attach. Best regards, Marcin Szamotulski -- -- You received this message from the vim_dev maillist. Do not
      Message 2 of 6 , Feb 3, 2014
      • 0 Attachment
        On 18:48 Mon 03 Feb , Marcin Szamotulski wrote:
        > Hello,
        >
        > I wrote a small patch which adds argisglobal() function which returns
        > 1 if the current buffer has global arglist otherwise, if there is
        > a local arg list it return 0. I haven't found any other way to test if
        > the arglist is gobal/local.
        >
        > I've been using this patch for some time already (I have a plugin
        > http://www.vim.org/scripts/script.php?script_id=4681 which is using it)
        > and it works fine.
        >
        > Best regards,
        > Marcin Szamotulski

        and here is the patch which I've forgotten to attach.

        Best regards,
        Marcin Szamotulski

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Bram Moolenaar
        ... I m sure someone will ask for another thing: What local argument list is being used. They can be shared between windows. A more generic solution would be
        Message 3 of 6 , Feb 5, 2014
        • 0 Attachment
          Marcin Szamotulski wrote:

          > I wrote a small patch which adds argisglobal() function which returns
          > 1 if the current buffer has global arglist otherwise, if there is
          > a local arg list it return 0. I haven't found any other way to test if
          > the arglist is gobal/local.
          >
          > I've been using this patch for some time already (I have a plugin
          > http://www.vim.org/scripts/script.php?script_id=4681 which is using it)
          > and it works fine.

          I'm sure someone will ask for another thing: What local argument list is
          being used. They can be shared between windows.

          A more generic solution would be to request the ID of the local argument
          list. When zero, then the window is using the global argument list.

          And then we of course also want to optionally pass in the window number.
          So it would be:

          arglistid([winnr])

          --
          hundred-and-one symptoms of being an internet addict:
          255. You work for a newspaper and your editor asks you to write an
          article about Internet addiction...in the "first person."

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ an exciting new programming language -- http://www.Zimbu.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Marcin Szamotulski
          ... Dear Bram, I attach the patch for arglistid(). Best regards, Marcin Szamotulski
          Message 4 of 6 , Apr 27, 2014
          • 0 Attachment
            On 08:22 Sat 08 Feb , Marcin Szamotulski wrote:
            > On 22:27 Fri 07 Feb , Bram Moolenaar wrote:
            > >
            > > Marcin Szamotulski wrote:
            > >
            > > > > > I wrote a small patch which adds argisglobal() function which returns
            > > > > > 1 if the current buffer has global arglist otherwise, if there is
            > > > > > a local arg list it return 0. I haven't found any other way to test if
            > > > > > the arglist is gobal/local.
            > > > > >
            > > > > > I've been using this patch for some time already (I have a plugin
            > > > > > http://www.vim.org/scripts/script.php?script_id=4681 which is using it)
            > > > > > and it works fine.
            > > > >
            > > > > I'm sure someone will ask for another thing: What local argument list is
            > > > > being used. They can be shared between windows.
            > > > >
            > > > > A more generic solution would be to request the ID of the local argument
            > > > > list. When zero, then the window is using the global argument list.
            > > > >
            > > > > And then we of course also want to optionally pass in the window number.
            > > > > So it would be:
            > > > >
            > > > > arglistid([winnr])
            > > >
            > > > Yes that's much better solution. I have a question though. The alist_T
            > > > structure does not contain an ID of arglist (only list of files, and
            > > > number of windows using it). How should I generate the ID?
            > >
            > > You could use the pointer and turn it into an int, but that's ugly (and
            > > doesn't work if sizeof(int) is smaller than sizeof(char *).
            > >
            > > So the best is to add an ID to alist_T and use a static global to store
            > > the last used ID. That's in alist_new().
            >
            > Thanks. I'll follow your advice.
            >
            > Best regards,
            > Marcin


            Dear Bram,

            I attach the patch for arglistid().


            Best regards,
            Marcin Szamotulski
          • Bram Moolenaar
            ... Thanks, I ll add it in the todo list. -- ... /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net /// sponsor Vim, vote for
            Message 5 of 6 , Apr 27, 2014
            • 0 Attachment
              Marcin Szamotulski wrote:

              > > > > > I'm sure someone will ask for another thing: What local argument
              > > > > > list is being used. They can be shared between windows.
              > > > > >
              > > > > > A more generic solution would be to request the ID of the local
              > > > > > argument list. When zero, then the window is using the global
              > > > > > argument list.
              > > > > >
              > > > > > And then we of course also want to optionally pass in the window
              > > > > > number. So it would be:
              > > > > >
              > > > > > arglistid([winnr])
              > > > >
              > > > > Yes that's much better solution. I have a question though. The
              > > > > alist_T structure does not contain an ID of arglist (only list of
              > > > > files, and number of windows using it). How should I generate the
              > > > > ID?
              > > >
              > > > You could use the pointer and turn it into an int, but that's ugly (and
              > > > doesn't work if sizeof(int) is smaller than sizeof(char *).
              > > >
              > > > So the best is to add an ID to alist_T and use a static global to store
              > > > the last used ID. That's in alist_new().
              > >
              > > Thanks. I'll follow your advice.
              >
              > I attach the patch for arglistid().

              Thanks, I'll add it in the todo list.


              --
              From "know your smileys":
              :-& Eating spaghetti

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ an exciting new programming language -- http://www.Zimbu.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --
              --
              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

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Marcin Szamotulski
              ... Thanks, Marcin Szamotulski
              Message 6 of 6 , Apr 27, 2014
              • 0 Attachment
                On 12:20 Sun 27 Apr , Bram Moolenaar wrote:
                >
                > Marcin Szamotulski wrote:
                >
                > > > > > > I'm sure someone will ask for another thing: What local argument
                > > > > > > list is being used. They can be shared between windows.
                > > > > > >
                > > > > > > A more generic solution would be to request the ID of the local
                > > > > > > argument list. When zero, then the window is using the global
                > > > > > > argument list.
                > > > > > >
                > > > > > > And then we of course also want to optionally pass in the window
                > > > > > > number. So it would be:
                > > > > > >
                > > > > > > arglistid([winnr])
                > > > > >
                > > > > > Yes that's much better solution. I have a question though. The
                > > > > > alist_T structure does not contain an ID of arglist (only list of
                > > > > > files, and number of windows using it). How should I generate the
                > > > > > ID?
                > > > >
                > > > > You could use the pointer and turn it into an int, but that's ugly (and
                > > > > doesn't work if sizeof(int) is smaller than sizeof(char *).
                > > > >
                > > > > So the best is to add an ID to alist_T and use a static global to store
                > > > > the last used ID. That's in alist_new().
                > > >
                > > > Thanks. I'll follow your advice.
                > >
                > > I attach the patch for arglistid().
                >
                > Thanks, I'll add it in the todo list.

                Thanks,

                Marcin Szamotulski
              Your message has been successfully submitted and would be delivered to recipients shortly.