Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  Refactor feed error handling
  Remove duplicate setting alias
  Update CHANGELOG
  Fix #23 :set autoindent
  Add :set hls alias for :set hlsearch
  Fix #35 :set ic and :set noic has no effect
  Fix #368 Disabling vintageous_hlsearch has no effect
  Fix unknown option status messages
  Refactor
  Fix #388 Executing register while recording causes recursion
  Refactor state
  Fix #94 Executing a register with a count
  Refactor registers
  Refactor ga
  Remove reload rc file status message
  Update Git metadata
  • Loading branch information
gerardroche committed Jan 3, 2019
2 parents cc46af5 + 09a63d8 commit 2610eb3
Show file tree
Hide file tree
Showing 29 changed files with 677 additions and 626 deletions.
18 changes: 9 additions & 9 deletions .gitattributes
Expand Up @@ -4,14 +4,14 @@

# Files and directories with the attribute export-ignore won’t be added to
# archive files. See http://git-scm.com/docs/gitattributes for details.
/*.sublime-project export-ignore
/.coveragerc export-ignore
/.flake8 export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitmodules export-ignore
/.travis.yml export-ignore
/appveyor.yml export-ignore
*.sublime-project export-ignore
.coveragerc export-ignore
.flake8 export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php_cs export-ignore
.travis.yml export-ignore
/ISSUE_TEMPLATE.md export-ignore
/tests/ export-ignore
/unittesting.json export-ignore
appveyor.yml export-ignore
unittesting.json export-ignore
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -25,4 +25,7 @@ tags
# Project
!/res/doc/tags
/covhtml/
/htmlcov/
/tmp/

mypy.ini
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,14 @@

All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## Unreleased

* Fixed [#23](https://github.com/NeoVintageous/NeoVintageous/issues/23): `:set autoindent`
* Fixed [#35](https://github.com/NeoVintageous/NeoVintageous/issues/35): `:set ic` and `:set noic` has no effect
* Fixed [#368](https://github.com/NeoVintageous/NeoVintageous/issues/368): Disabling `vintageous_hlsearch` appears to have no effect
* Fixed [#388](https://github.com/NeoVintageous/NeoVintageous/issues/388): Executing register while recording causes recursion error
* Fixed [#94](https://github.com/NeoVintageous/NeoVintageous/issues/94): Executing a register with a count, `[count]@q{register}` doesn't work

## 1.7.1 - 2018-12-24

* Fixed [#377](https://github.com/NeoVintageous/NeoVintageous/issues/377): Add backtick mark jumps to jumplist
Expand Down
4 changes: 0 additions & 4 deletions Preferences.sublime-settings
Expand Up @@ -41,10 +41,6 @@
// * stippled_underline
"neovintageous_search_occ_style": "outline",

// Enable auto indentation.
// https://vimhelp.appspot.com/options.txt.html#%27autoindent%27
"vintageous_autoindent": true,

// Enable ':' and ex commands.
// {not in Vim}
"vintageous_enable_cmdline_mode": true,
Expand Down
34 changes: 13 additions & 21 deletions nv/cmds.py
Expand Up @@ -64,7 +64,6 @@
from NeoVintageous.nv.vim import OPERATOR_PENDING
from NeoVintageous.nv.vim import REPLACE
from NeoVintageous.nv.vim import SELECT
from NeoVintageous.nv.vim import status_message
from NeoVintageous.nv.vim import VISUAL
from NeoVintageous.nv.vim import VISUAL_BLOCK
from NeoVintageous.nv.vim import VISUAL_LINE
Expand Down Expand Up @@ -259,6 +258,18 @@ def run(self, edit, commands):
class _nv_feed_key(ViWindowCommandBase):

def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
start_time = time.time()

_log.info('key evt: %s repeat_count=%s do_eval=%s check_user_mappings=%s', key, repeat_count, do_eval, check_user_mappings) # noqa: E501

try:
self._feed_key(key, repeat_count, do_eval, check_user_mappings)
except Exception as e:
_log.exception(e)

_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

def _feed_key(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
# Args:
# key (str): Key pressed.
# repeat_count (int): Count to be used when repeating through the '.' command.
Expand All @@ -268,8 +279,6 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
# state's evaluation. For example, this is what the _nv_feed_key
# command does.
# check_user_mappings (bool):
start_time = time.time()
_log.info('key evt: %s repeat_count=%s do_eval=%s check_user_mappings=%s', key, repeat_count, do_eval, check_user_mappings) # noqa: E501
state = self.state

# If the user has made selections with the mouse, we may be in an
Expand All @@ -284,7 +293,6 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
if key.lower() == '<esc>':
self.window.run_command('_enter_normal_mode', {'mode': state.mode})
state.reset_command_data()
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

Expand All @@ -295,7 +303,6 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
_log.debug('capturing register name...')
state.register = key
state.partial_sequence = ''
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

Expand All @@ -309,33 +316,29 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
state.eval()
state.reset_command_data()

_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

if repeat_count:
state.action_count = str(repeat_count)

if self._handle_count(state, key, repeat_count):
_log.debug('handled count')
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

state.partial_sequence += key

if check_user_mappings and mappings_is_incomplete(state.mode, state.partial_sequence):
_log.debug('found incomplete mapping')
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

command = mappings_resolve(state, check_user_mappings=check_user_mappings)
_log.debug('command %s %s', command, command.__class__.__mro__)

if isinstance(command, ViOpenRegister):
_log.debug('opening register...')
state.must_capture_register_name = True
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

Expand All @@ -362,21 +365,17 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):

if ':' in new_keys:
do_ex_user_cmdline(self.window, new_keys)
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

self.window.run_command('_nv_process_notation', {'keys': new_keys, 'check_user_mappings': False})

_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

if isinstance(command, ViOpenNameSpace):
# Keep collecting input to complete the sequence. For example, we
# may have typed 'g'
_log.info('opening namespace')
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

Expand All @@ -400,7 +399,6 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
_log.debug('unmapped sequence %s', state.sequence)
state.mode = NORMAL
state.reset_command_data()
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return ui_blink()

Expand All @@ -416,7 +414,6 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
if isinstance(command, ViMissingCommandDef):
_log.debug('unmapped sequence %s', state.sequence)
state.reset_command_data()
_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

return

Expand All @@ -432,8 +429,6 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):
_log.info('evaluating state...')
state.eval()

_log.debug('key evt took {:.4f}s'.format(time.time() - start_time))

def _handle_count(self, state, key, repeat_count):
"""Return True if the processing of the current key needs to stop."""
if not state.action and key.isdigit():
Expand Down Expand Up @@ -847,15 +842,12 @@ class NeovintageousReloadMyRcFileCommand(WindowCommand):
def run(self):
rc.reload()

status_message('runtime configuation file reloaded')


class NeovintageousToggleSideBarCommand(WindowCommand):

def run(self):
self.window.run_command('toggle_side_bar')

# Requires >= Sublime Text 3115 (is_sidebar_visible we added in 3115).
if self.window.is_sidebar_visible():
self.window.run_command('focus_side_bar')
else:
Expand Down

0 comments on commit 2610eb3

Please sign in to comment.