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

67435Re: YAML indentation file

Expand Messages
  • ZyX
    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
    • Show all 5 messages in this topic