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

autoformat behaves like textwidth were 80 while textwidth is 0

Expand Messages
  • Georg Dahn
    Hi! I don t understand the following behavior: 1. gvim -u NONE -N 2. set formatoptions+=tcroqn2ba I maximize Vim now, such that I have really many columns. Vim
    Message 1 of 7 , May 5, 2006
    • 0 Attachment
      Hi!

      I don't understand the following behavior:

      1. gvim -u NONE -N
      2. set formatoptions+=tcroqn2ba

      I maximize Vim now, such that I have really many columns.
      Vim behaves as if textwidth were 80 although it is 0. Why?

      I am using gVim 7.0g03 but I think, that this was the same
      with 6.4.

      Best wishes,
      Georg







      Send instant messages to your online friends http://uk.messenger.yahoo.com
    • Bram Moolenaar
      ... Where does Vim behave like textwidth is 80? If you do formatting for some reason and textwidth is zero then 80 is used. If you want another value
      Message 2 of 7 , May 5, 2006
      • 0 Attachment
        Georg Dahn wrote:

        > I don't understand the following behavior:
        >
        > 1. gvim -u NONE -N
        > 2. set formatoptions+=tcroqn2ba
        >
        > I maximize Vim now, such that I have really many columns.
        > Vim behaves as if textwidth were 80 although it is 0. Why?
        >
        > I am using gVim 7.0g03 but I think, that this was the same
        > with 6.4.

        Where does Vim behave like 'textwidth' is 80? If you do formatting for
        some reason and 'textwidth' is zero then 80 is used. If you want
        another value then set 'textwidth' and tune 'formatoptions' to only
        format where you want to.

        --
        How To Keep A Healthy Level Of Insanity:
        8. Don't use any punctuation marks.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
      • Georg Dahn
        Hi! ... I did not know that and could not find it in the documentation. Maybe it would be good to add a remark (or have I missed it?). Thanks! Best wishes,
        Message 3 of 7 , May 5, 2006
        • 0 Attachment
          Hi!

          --- Bram Moolenaar <Bram@...> wrote:
          > If you do formatting for some reason and 'textwidth'
          > is zero then 80 is used.

          I did not know that and could not find it in the documentation. Maybe
          it would be good to add a remark (or have I missed it?).

          Thanks!

          Best wishes,
          Georg







          ___________________________________________________________
          Yahoo! Photos – NEW, now offering a quality print service from just 7p a photo http://uk.photos.yahoo.com
        • Georg Dahn
          Hi! ... just scroll down to ... With t and c you can specify when Vim performs auto-wrapping: value action ~ no automatic formatting (you can use gq
          Message 4 of 7 , May 5, 2006
          • 0 Attachment
            Hi!

            --- Bram Moolenaar <Bram@...> wrote:
            > It's mentioned at "gq". Any other place it should be mentioned?

            I would say, here:

            :h fo-table

            just scroll down to

            -----
            With 't' and 'c' you can specify when Vim performs auto-wrapping:
            value action ~
            "" no automatic formatting (you can use "gq" for manual formatting)
            "t" automatic formatting of text, but not comments
            "c" automatic formatting for comments, but not text (good for C code)
            "tc" automatic formatting for text and comments

            Note that when 'textwidth' is 0, Vim does no formatting anyway (but
            does
            insert comment leaders according to the 'comments' option).
            -----

            to me, this is wrong, because if autoformatting wraps at 80, if
            textwidth is zero, then it is wrong to say, that Vim does no formatting
            in this case. I think, that a remark is really missing here.

            It may be senseful at the following places, too, although I don't
            consider it as important as in the above case:

            :help textwidth
            :ins-textwidth

            a remark could be fine, too. Especially here: ins-textwidth

            -----
            If you set 'textwidth' to 0, this feature is disabled.
            -----

            If autoformatting 'a' and the 't' flag of the formatoptions are
            enabled, this is not true.

            Note, that I really searched the help files before I wrote to the
            mailing list. What I expected after reading the help files, was a
            wrapping at the right border of the window.

            Best wishes,
            Georg









            ___________________________________________________________
            NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
          • Bram Moolenaar
            ... When does Vim do automatic formatting when textwidth is zero? I don t see an obvious situation. Looking at the code it doesn t seem to be possible. ...
            Message 5 of 7 , May 5, 2006
            • 0 Attachment
              Georg Dahn wrote:

              > --- Bram Moolenaar <Bram@...> wrote:
              > > It's mentioned at "gq". Any other place it should be mentioned?
              >
              > I would say, here:
              >
              > :h fo-table
              >
              > just scroll down to
              >
              > -----
              > With 't' and 'c' you can specify when Vim performs auto-wrapping:
              > value action ~
              > "" no automatic formatting (you can use "gq" for manual formatting)
              > "t" automatic formatting of text, but not comments
              > "c" automatic formatting for comments, but not text (good for C code)
              > "tc" automatic formatting for text and comments
              >
              > Note that when 'textwidth' is 0, Vim does no formatting anyway (but
              > does
              > insert comment leaders according to the 'comments' option).
              > -----
              >
              > to me, this is wrong, because if autoformatting wraps at 80, if
              > textwidth is zero, then it is wrong to say, that Vim does no formatting
              > in this case. I think, that a remark is really missing here.

              When does Vim do automatic formatting when 'textwidth' is zero? I don't
              see an obvious situation. Looking at the code it doesn't seem to be
              possible.

              > It may be senseful at the following places, too, although I don't
              > consider it as important as in the above case:
              >
              > :help textwidth
              > :ins-textwidth
              >
              > a remark could be fine, too. Especially here: ins-textwidth
              >
              > -----
              > If you set 'textwidth' to 0, this feature is disabled.
              > -----
              >
              > If autoformatting 'a' and the 't' flag of the formatoptions are
              > enabled, this is not true.

              I don't see why.

              > Note, that I really searched the help files before I wrote to the
              > mailing list. What I expected after reading the help files, was a
              > wrapping at the right border of the window.

              You still haven't told us how you cause the formatting to take place.

              --
              How To Keep A Healthy Level Of Insanity:
              14. Put mosquito netting around your work area. Play a tape of jungle
              sounds all day.

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ download, build and distribute -- http://www.A-A-P.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
            • Georg Dahn
              Hi! ... As I wrote: 1. gvim -u NONE -N 2. set formatoptions+=tcroqn2ba Just write anything... the text wraps at column 80. The option textwidth is zero and
              Message 6 of 7 , May 5, 2006
              • 0 Attachment
                Hi!

                > When does Vim do automatic formatting when 'textwidth' is
                > zero? I don't see an obvious situation. Looking at the
                > code it doesn't seem to be possible.

                As I wrote:

                1. gvim -u NONE -N
                2. set formatoptions+=tcroqn2ba

                Just write anything... the text wraps at column 80. The option
                'textwidth' is zero and the option 'wrapmargin' is zero, too.
                That the text wraps at 80, was what I did not understand. It
                is a hard wrapping, not a soft wrapping. Just maximize gVim.
                The text wraps at 80 even if the window has more than 100 cols.

                > You still haven't told us how you cause the formatting to
                > take place.

                See my mail from 05.05.2006 10:32:07:

                > I don't understand the following behavior:
                >
                > 1. gvim -u NONE -N
                > 2. set formatoptions+=tcroqn2ba
                >
                > I maximize Vim now, such that I have really many columns.
                > Vim behaves as if textwidth were 80 although it is 0. Why?
                >
                > I am using gVim 7.0g03 but I think, that this was the same
                > with 6.4.

                I am referring to the following statement of your answer:

                > If you do formatting for some reason and 'textwidth' is zero
                > then 80 is used.

                There are two possibilities:

                Does this statement hold for autoformatting? If the answer is
                'yes', then this is a feature and the documentation is a
                little bit misleading. If the answer is 'no', then I have
                found a bug.

                Best wishes,
                Georg





                Send instant messages to your online friends http://uk.messenger.yahoo.com
              • Bram Moolenaar
                ... Ah, you have enabled auto formatting. Sorry, didn t get that at first. That is done even when textwidth is zero. I ll add a remark about that. -- How
                Message 7 of 7 , May 5, 2006
                • 0 Attachment
                  Georg Dahn wrote:

                  > > When does Vim do automatic formatting when 'textwidth' is
                  > > zero? I don't see an obvious situation. Looking at the
                  > > code it doesn't seem to be possible.
                  >
                  > As I wrote:
                  >
                  > 1. gvim -u NONE -N
                  > 2. set formatoptions+=tcroqn2ba
                  >
                  > Just write anything... the text wraps at column 80. The option
                  > 'textwidth' is zero and the option 'wrapmargin' is zero, too.
                  > That the text wraps at 80, was what I did not understand. It
                  > is a hard wrapping, not a soft wrapping. Just maximize gVim.
                  > The text wraps at 80 even if the window has more than 100 cols.

                  Ah, you have enabled auto formatting. Sorry, didn't get that at first.
                  That is done even when 'textwidth' is zero. I'll add a remark about
                  that.

                  --
                  How To Keep A Healthy Level Of Insanity:
                  16. Have your coworkers address you by your wrestling name, Rock Hard Kim.

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ download, build and distribute -- http://www.A-A-P.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
                Your message has been successfully submitted and would be delivered to recipients shortly.