Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

2.4.0 – Timeouts

Latest
Compare
Choose a tag to compare
@Iron-E Iron-E released this 29 Apr 19:37
· 5 commits to master since this release
5f67d1b

Changes

Key Combos

Timeouts

  • Add g:libmodalTimeouts and mode-specific timeout variables.
  • Modes can now optionally time-out when waiting for user input (input will clear, just like in normal mode).
    • This will only occur if the user has entered a key that has a mapping in the modeCombos dict. Otherwise, the user's input will be automatically cleared.
  • Timeouts are not implemented for modeCallbacks— they must be implemented by mode creators using timers.

Cloberring

  • Key combos no longer clobber each other when they share beginnings that are shorter.

    • e.g. zfo used to wipe out any z or zf mappings (although zfx would work just fine).
  • When a combo has both a command and sub-mappings, it is now automatically mapped to <CR>.

    • e.g.:
     let s:modeCombos = {
     \	'z': 'split',
     \	'zf': 'tabnew'
     \	'zfo': 'tabclose'
     \}

    Is now translated to:

     let s:internalModeCombos = {
     \	'z': {
     \		'<CR>': 'split',
     \		'f': {
     \			'<CR>': 'tabnew',
     \			'o': 'tabclose'
     \		}
     \	}
     \}
    • Dictionaries are not expanded to include <CR> annotations until necessary, in order to be more space-efficient.
  • Unfortunately, the g:libmodalTimeout feature will not automatically execute these commands for you.

    • This is a limitation of Vimscript. There is a rewrite of this plugin being developed for Neovim only that is capable of doing this and more (find it here when it is complete).