Skip to content

Commit

Permalink
fix v_o should update the cursor x position
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche authored and eugenesvk committed Jan 8, 2024
1 parent e8ab5df commit 2a0c462
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt

### Fixed

- [#974](https://github.com/NeoVintageous/NeoVintageous/issues/974): `v_o` should update the cursor x position.
- [#963](https://github.com/NeoVintageous/NeoVintageous/issues/963): Don't populate small delete when a register is specified.
- [#962](https://github.com/NeoVintageous/NeoVintageous/issues/962): `zt`, `zb`, and `zz` should maintain cursor column.
- [#962](https://github.com/NeoVintageous/NeoVintageous/issues/962): `z<CR>`, `z-`, and `z.` should position the cursor on the first non-blank.
Expand Down
2 changes: 1 addition & 1 deletion nv/vi/cmd_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def init(self):
class ViGoToOtherEnd(ViOperatorDef):
def init(self):
self.scroll_into_view = True
self.updates_xpos = False
self.updates_xpos = True
self.command = 'nv_vi_visual_o'


Expand Down
5 changes: 5 additions & 0 deletions tests/functional/test_o.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def test_V(self):
self.eq('r_x\n|fizz\n|x', 'V_o', 'x\n|fizz\n|x')
self.assertStatusLineIsVisualLine()

def test_issue_974_xpos_should_be_updated(self):
self.eq('fizz\nfi|zz\nfizz buzz\nfizz bu|zz', 'v_o', 'r_fizz\nfi|zz\nfizz buzz\nfizz bu|zz')
self.feed('j')
self.assertRVisual('fizz\nfizz\nfi|zz buzz\nfizz bu|zz')


class Test_o_auto_indent(unittest.FunctionalTestCase):

Expand Down

0 comments on commit 2a0c462

Please sign in to comment.