From 3304f4e95ad8756e3e0e0f6e673d950f8368629f Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 3 Oct 2013 16:06:23 +0900 Subject: [PATCH] Make set both left and right margin to zero (Undocumented) will clear *UP* left_margin, right_margin, and stick_to_left --- README.md | 1 + autoload/easy_align.vim | 6 +++++- doc/easy_align.txt | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0f1f0d..1e26ac1 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ keys listed below. The meaning of each option will be described in | `CTRL-O` | `mode_sequence` | Input string of `/[lrc]+\*{0,2}/` | | `` | `stick_to_left` | `{ 'stick_to_left': 1, 'left_margin': 0 }` | | `` | `stick_to_left` | `{ 'stick_to_left': 0, 'left_margin': 1 }` | +| `` | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` | --- diff --git a/autoload/easy_align.vim b/autoload/easy_align.vim index 1dc7d40..46df4e0 100644 --- a/autoload/easy_align.vim +++ b/autoload/easy_align.vim @@ -629,9 +629,13 @@ function! s:interactive(modes, vis, opts, delims) elseif c == "\" let opts['stl'] = 0 let opts['lm'] = 1 - elseif c == "\" || c == "\" + elseif c == "\" + let opts['lm'] = 0 + let opts['rm'] = 0 + elseif c == "\" silent! call remove(opts, 'stl') silent! call remove(opts, 'lm') + silent! call remove(opts, 'rm') elseif ch == "\" let modes = tolower(s:input("Mode sequence: ", get(opts, 'm', mode), a:vis)) if match(modes, '^[lrc]\+\*\{0,2}$') != -1 diff --git a/doc/easy_align.txt b/doc/easy_align.txt index 6910424..d55c30c 100644 --- a/doc/easy_align.txt +++ b/doc/easy_align.txt @@ -97,6 +97,7 @@ described in the following sections. | CTRL-O | mode_sequence | Input string of /[lrc]+\*{0,2}/ | | | stick_to_left | { 'stick_to_left': 1, 'left_margin': 0 } | | | stick_to_left | { 'stick_to_left': 0, 'left_margin': 1 } | +| | *_margin | { 'left_margin': 0, 'right_margin': 0 } | Non-interactive mode