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

Bug or feature? [-] for helpfiles when 'statusline' nonempty

Expand Messages
  • Antoine J. Mechelynck
    With statusline empty, normal files have [+] when modified, otherwise nothing at that position; help files, at least when not modified (the usual case),
    Message 1 of 4 , May 29, 2004
    • 0 Attachment
      With 'statusline' empty, "normal" files have [+] when modified, otherwise
      nothing at that position; help files, at least when not modified (the usual
      case), have nothing.

      After

      set statusline=%<%f\
      %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\
      &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P

      (all on one line), "normal" unmodified files still have nothing. Help files
      have [-] even though ":setl mod?" answers "nomodified".

      Bug or feature? My understanding was that %m means

      print nothing if 'nomodified'
      print [+] if 'modified' and 'noreadonly'
      print [-] if 'modified' but 'readonly' (the help says if 'nomodifiable' but
      how can we have 'modified' if 'nomodifiable'?)

      Apparently I misunderstood? Does [-] mean 'nomodifiable' then, regardless of
      'modified' status (which will be off)? If so, why does that flag _not_
      appear on helpfiles with 'statusline' empty?

      Regards,
      Tony.
    • Bram Moolenaar
      ... I don t know why you expected %m to behave this way. The docs mention: m F Modified flag, text is [+] or [-] if modifiable is off. The idea is
      Message 2 of 4 , May 30, 2004
      • 0 Attachment
        Antoine J. Mechelynck wrote:

        > With 'statusline' empty, "normal" files have [+] when modified, otherwise
        > nothing at that position; help files, at least when not modified (the usual
        > case), have nothing.
        >
        > After
        >
        > set statusline=%<%f\
        > %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\
        > &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
        >
        > (all on one line), "normal" unmodified files still have nothing. Help files
        > have [-] even though ":setl mod?" answers "nomodified".
        >
        > Bug or feature? My understanding was that %m means
        >
        > print nothing if 'nomodified'
        > print [+] if 'modified' and 'noreadonly'
        > print [-] if 'modified' but 'readonly' (the help says if 'nomodifiable' but
        > how can we have 'modified' if 'nomodifiable'?)
        >
        > Apparently I misunderstood? Does [-] mean 'nomodifiable' then, regardless of
        > 'modified' status (which will be off)? If so, why does that flag _not_
        > appear on helpfiles with 'statusline' empty?

        I don't know why you expected %m to behave this way. The docs mention:

        m F Modified flag, text is " [+]" or " [-]" if 'modifiable' is off.

        The idea is that a "normal" file doesn't show anything. It is not
        normal for a file to be not modifiable.

        With 'statusline' empty something a bit more clever is done, mentioning
        "help" is enough to let the user know what kind of buffer it is.

        --
        A)bort, R)etry, B)ang it with a large hammer

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
      • Antoine J. Mechelynck
        Bram Moolenaar wrote: [...] ... So I was mistaken. No way to reproduce the behaviour of the empty option (let s say I want to make a small
        Message 3 of 4 , May 30, 2004
        • 0 Attachment
          Bram Moolenaar <Bram@...> wrote:
          [...]
          > I don't know why you expected %m to behave this way. The docs
          > mention:
          >
          > m F Modified flag, text is " [+]" or " [-]" if 'modifiable' is off.
          >
          > The idea is that a "normal" file doesn't show anything. It is not
          > normal for a file to be not modifiable.
          >
          > With 'statusline' empty something a bit more clever is done,
          > mentioning "help" is enough to let the user know what kind of buffer
          > it is.

          So I was mistaken. No way to reproduce the behaviour of the empty option
          (let's say I want to make a small change at another point of the status
          line), other than by means of an explicit expression, is there? Oh, well.
          Every day brings its bit of learning. Guess I'll have to nest (?:) operators
          there.

          >
          > --
          > A)bort, R)etry, B)ang it with a large hammer
          >
          > /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net
          > \\\ /// Sponsor Vim, vote for features --
          > http://www.Vim.org/sponsor/ \\\ \\\ Project leader for
          > A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help
          > AIDS victims -- http://ICCF.nl/click1.html ///

          Best regards,
          Tony.
        • Keith Roberts
          ... It is ambiguous to me as well. You might change it to: m F Modified flag, text is [+] if modified, or [-] if modifiable is off.
          Message 4 of 4 , Jun 1, 2004
          • 0 Attachment
            >-----Original Message-----
            >From: Bram@... [mailto:Bram@...]
            >Sent: Sunday, May 30, 2004 9:52 AM
            >To: Antoine J. Mechelynck
            >Cc: vim@...
            >Subject: Re: Bug or feature? [-] for helpfiles when
            >'statusline' nonempty
            >
            >
            >Antoine J. Mechelynck wrote:
            >
            >> With 'statusline' empty, "normal" files have [+] when modified,
            >> otherwise nothing at that position; help files, at least when not
            >> modified (the usual case), have nothing.
            >>
            >> After
            >>
            >> set statusline=%<%f\
            >> %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\
            >> &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
            >>
            >> (all on one line), "normal" unmodified files still have
            >nothing. Help
            >> files have [-] even though ":setl mod?" answers "nomodified".
            >>
            >> Bug or feature? My understanding was that %m means
            >>
            >> print nothing if 'nomodified'
            >> print [+] if 'modified' and 'noreadonly'
            >> print [-] if 'modified' but 'readonly' (the help says if
            >> 'nomodifiable' but how can we have 'modified' if 'nomodifiable'?)
            >>
            >> Apparently I misunderstood? Does [-] mean 'nomodifiable' then,
            >> regardless of 'modified' status (which will be off)? If so, why does
            >> that flag _not_ appear on helpfiles with 'statusline' empty?
            >
            >I don't know why you expected %m to behave this way. The docs mention:
            >
            > m F Modified flag, text is " [+]" or " [-]" if
            >'modifiable' is off.

            It is ambiguous to me as well. You might change it to:
            m F Modified flag, text is " [+]" if modified, or " [-]" if
            'modifiable' is off.
          Your message has been successfully submitted and would be delivered to recipients shortly.