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

Re: YAML indentation file

Expand Messages
  • ZyX
    # HG changeset patch # User ZyX # Date 1354721282 -14400 # Node ID fdde3db8b31e1b37a0e29441471d19be9adf35c2 # Parent
    Message 1 of 5 , Dec 5, 2012
    • 0 Attachment
      # HG changeset patch
      # User ZyX <kp-pav@...>
      # Date 1354721282 -14400
      # Node ID fdde3db8b31e1b37a0e29441471d19be9adf35c2
      # Parent baf3d5da0a1c9f2334a472f7690abfbc235fbf74
      Added undo_indent and cpo saving/setting

      diff -r baf3d5da0a1c -r fdde3db8b31e runtime/indent/yaml.vim
      --- a/runtime/indent/yaml.vim Wed Dec 05 08:44:50 2012 +0400
      +++ b/runtime/indent/yaml.vim Wed Dec 05 19:28:02 2012 +0400
      @@ -3,18 +3,23 @@
      " Maintainer: Nikolai Pavlov <zyx.vim@...>

      " Only load this indent file when no other was loaded.
      -if exists("b:did_indent")
      +if exists('b:did_indent')
      finish
      endif

      +let s:save_cpo = &cpo
      +set cpo&vim
      +
      let b:did_indent = 1

      setlocal indentexpr=GetYAMLIndent(v:lnum)
      setlocal indentkeys=!^F,o,O,0#,0},0],<:>,-
      setlocal nosmartindent

      +let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<'
      +
      " Only define the function once.
      -if exists("*GetYAMLIndent")
      +if exists('*GetYAMLIndent')
      finish
      endif

      @@ -123,3 +128,5 @@
      endif
      return previndent
      endfunction
      +
      +let &cpo = s:save_cpo

      --
      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
    • Bram Moolenaar
      ... Thanks. For me it s a bit easier if you send the whole file instead of a patch. -- hundred-and-one symptoms of being an internet addict: 105. When someone
      Message 2 of 5 , Dec 5, 2012
      • 0 Attachment
        ZyX wrote:

        > Added undo_indent and cpo saving/setting

        Thanks. For me it's a bit easier if you send the whole file instead of
        a patch.

        --
        hundred-and-one symptoms of being an internet addict:
        105. When someone asks you for your address, you tell them your URL.

        /// 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
      • ZyX
        ... a patch. https://bitbucket.org/ZyX_I/vim/raw/262f483812f8f7c5a0e6c9a43cd1967782b7b9ed/runtime/indent/yaml.vim Google groups interface for some reason does
        Message 3 of 5 , Dec 5, 2012
        • 0 Attachment
          > Thanks. For me it's a bit easier if you send the whole file instead of
          a patch.

          https://bitbucket.org/ZyX_I/vim/raw/262f483812f8f7c5a0e6c9a43cd1967782b7b9ed/runtime/indent/yaml.vim

          Google groups interface for some reason does not like “.vim” extension.

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