Skip to content

Commit

Permalink
Add $ in Visual line mode #491
Browse files Browse the repository at this point in the history
Close #491
  • Loading branch information
gerardroche committed Apr 16, 2019
1 parent 26802b2 commit e5d95ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt

### Added

* Added [#491](https://github.com/NeoVintageous/NeoVintageous/issues/491): `$` in Visual line mode
* Added [#490](https://github.com/NeoVintageous/NeoVintageous/issues/490): `[{`, `[(`, `]}`, and `])` in Visual line mode
* Added [#284](https://github.com/NeoVintageous/NeoVintageous/issues/284): Support for `%` in shell commands

Expand Down
2 changes: 2 additions & 0 deletions nv/commands.py
Expand Up @@ -3841,6 +3841,8 @@ def f(view, s):
s = Region(eol if view.line(eol).empty() else (eol - 1))
elif mode == VISUAL:
s = resolve_visual_target(s, eol)
elif mode == VISUAL_LINE:
s = resolve_visual_line_target(view, s, eol)
elif mode == INTERNAL_NORMAL:
if get_bol(view, s.a) == s.a:
s = Region(s.a, eol + 1)
Expand Down
6 changes: 6 additions & 0 deletions tests/functional/test__dollar.py
Expand Up @@ -41,6 +41,12 @@ def test_v(self):

def test_V(self):
self.eq('|abc\n|abc\nabc\n', 'l_$', '|abc\n|abc\nabc\n')
self.eq('1\n|fizz\n|buzz\nfour\nfive', 'l_2$', '1\n|fizz\nbuzz\n|four\nfive')
self.eq('1\n|fizz\n|buzz\nfour\nfive', 'l_3$', '1\n|fizz\nbuzz\nfour\n|five')
self.eq('1\n|fizz\n|buzz\nfour\nfive', 'l_4$', '1\n|fizz\nbuzz\nfour\nfive|')
self.eq('1\n|fizz\n|buzz\nfour\nfive', 'l_9$', '1\n|fizz\nbuzz\nfour\nfive|')
self.eq('r_1\n|fizz\nbuzz\n|four\nfive', 'l_2$', 'r_1\nfizz\n|buzz\n|four\nfive')
self.eq('r_1\n|fizz\nbuzz\n|four\nfive', 'l_3$', '1\nfizz\n|buzz\nfour\n|five')

def test_N(self):
self.eq('|abc\nabc\n', '$', 'N_|abc\n|abc\n')
Expand Down

0 comments on commit e5d95ac

Please sign in to comment.