Skip to content

Commit

Permalink
Fix #226 Mouse does not reset cursor column
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche committed Dec 15, 2017
1 parent ee0fbed commit 42becc2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt

### Fixed

* Fixed: [#226](https://github.com/NeoVintageous/NeoVintageous/issues/226): Mouse does not reset cursor column
* Fixed: `C-w _` (set current group height as high as possible) doesn't always work correctly
* Fixed: `C-w |` (set current group width as wide as possible) doesn't always work correctly
* Fixed: `C-w =` (resize all groups equally) doesn't always work correctly
Expand Down
13 changes: 13 additions & 0 deletions lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,19 @@ def on_text_command(self, view, command, args):
]
})

def on_post_text_command(self, view, command, args):
# This fixes issues where the xpos is not updated after a mouse click
# moves the cursor position. These issues look like they could be
# compounded by issues in the _vi_adjust_carets command. See
# on_post_save(). The xpos only needs to be updated on single mouse
# click.
if command == 'drag_select':
if set(args) == {'event'}:
if set(args['event']) == {'x', 'y', 'button'}:
if args['event']['button'] == 1:
state = State(view)
state.update_xpos(force=True)

def on_load(self, view):
if view.settings().get('vintageous_modeline', False):
modeline(view)
Expand Down

0 comments on commit 42becc2

Please sign in to comment.