File: single-character-objects.vim

package info (click to toggle)
vim-textobj-user 0.7.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 208 kB
  • sloc: makefile: 2
file content (31 lines) | stat: -rw-r--r-- 667 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
call textobj#user#plugin('number', {
\   'real': {
\     'pattern': '\v\d+(\.\d+)?',
\     'select': ['an', 'in'],
\   }
\ })

describe 'textobj-user'
  before
    new
    put ='2abc'
    put ='         2.    abc2232'
    1 delete _
  end

  after
    close!
  end

  it 'selects a number object with a single digit'
    normal 1Gvany
    Expect [line("'<"), col("'<"), line("'>"), col("'>")] == [1, 1, 1, 1]
    normal 2Gvany
    Expect [line("'<"), col("'<"), line("'>"), col("'>")] == [2, 10, 2, 10]
  end

  it 'selects a number object with multiple digit'
    normal 2Gf2vany
    Expect [line("'<"), col("'<"), line("'>"), col("'>")] == [2, 19, 2, 22]
  end
end