mirror of
https://github.com/machakann/vim-sandwich.git
synced 2026-05-28 00:26:34 +02:00
Define a new behavior of 'skip_space' option when it is 2.
This commit is contained in:
@@ -737,7 +737,7 @@ function! s:search(recipes) dict abort "{{{
|
||||
if i == 1 || opt.integrated.skip_space
|
||||
let head_c = s:get_cursorchar(head)
|
||||
let tail_c = s:get_cursorchar(tail)
|
||||
if head_c ==# tail_c
|
||||
if head_c ==# tail_c && !(opt.integrated.skip_space == 2 && head_c =~# '\s')
|
||||
let target = {
|
||||
\ 'head1': head, 'tail1': head,
|
||||
\ 'head2': tail, 'tail2': tail,
|
||||
@@ -2305,7 +2305,7 @@ let s:default_opt.delete.line = {
|
||||
\ 'cursor' : 'inner_head',
|
||||
\ 'noremap' : 1,
|
||||
\ 'regex' : 0,
|
||||
\ 'skip_space': 1,
|
||||
\ 'skip_space': 2,
|
||||
\ 'skip_char' : 0,
|
||||
\ 'highlight' : 1,
|
||||
\ 'command' : [],
|
||||
@@ -2344,7 +2344,7 @@ let s:default_opt.replace.line = {
|
||||
\ 'regex' : 0,
|
||||
\ 'expr' : 0,
|
||||
\ 'noremap' : 1,
|
||||
\ 'skip_space': 1,
|
||||
\ 'skip_space': 2,
|
||||
\ 'skip_char' : 0,
|
||||
\ 'highlight' : 1,
|
||||
\ 'command' : [],
|
||||
|
||||
@@ -862,8 +862,8 @@ highlight
|
||||
|
||||
|
||||
skip_space
|
||||
値が真なら、指定された文字列の両端がスペースであった場合にこれらをスキ
|
||||
ップします。
|
||||
値が 1 なら、指定された文字列の両端がスペースであった場合にこれらをス
|
||||
キップします。
|
||||
>
|
||||
let g:sandwich#recipes += [
|
||||
\ {'buns': ['(', ')'], 'skip_space': 0}
|
||||
@@ -887,6 +887,7 @@ skip_space
|
||||
" Press sda"
|
||||
" ?"foo" ---> ?foo : ? is space
|
||||
<
|
||||
両端が空白の場合にもこれをスキップするためには値を 2 にします。
|
||||
|
||||
デフォルト値
|
||||
* add
|
||||
@@ -895,11 +896,11 @@ skip_space
|
||||
- block: 1
|
||||
* delete
|
||||
- char : 1
|
||||
- line : 1
|
||||
- line : 2
|
||||
- block: 1
|
||||
* replace
|
||||
- char : 1
|
||||
- line : 1
|
||||
- line : 2
|
||||
- block: 1
|
||||
|
||||
|
||||
|
||||
@@ -870,7 +870,7 @@ highlight
|
||||
|
||||
skip_space
|
||||
This option enables to skip spaces at both ends of a assigned region.
|
||||
If the value is true, adjust the both ends to skip white spaces.
|
||||
If the value is 1, adjust the both ends to skip white spaces.
|
||||
>
|
||||
let g:sandwich#recipes += [
|
||||
\ {'buns': ['(', ')'], 'skip_space': 0}
|
||||
@@ -895,6 +895,8 @@ skip_space
|
||||
" Press sda"
|
||||
" ?"foo" ---> ?foo : ? is space
|
||||
<
|
||||
If the value is 2, adjust the both ends to skip white spaces even
|
||||
though the both ends are white spaces.
|
||||
|
||||
Default values
|
||||
* add
|
||||
@@ -902,13 +904,13 @@ skip_space
|
||||
- line : 1
|
||||
- block: 1
|
||||
* delete
|
||||
- char : 1
|
||||
- line : 1
|
||||
- block: 1
|
||||
- char : 2
|
||||
- line : 2
|
||||
- block: 2
|
||||
* replace
|
||||
- char : 1
|
||||
- line : 1
|
||||
- block: 1
|
||||
- char : 2
|
||||
- line : 2
|
||||
- block: 2
|
||||
|
||||
|
||||
|
||||
|
||||
+2002
-1833
File diff suppressed because it is too large
Load Diff
+4642
-4478
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user