mirror of
				https://github.com/chylex/IntelliJ-IdeaVim.git
				synced 2025-10-31 02:17:13 +01:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			b7c1ba4f02
			...
			VIM-3615
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8cad0e6434 | 
| @@ -218,13 +218,17 @@ internal class VimEnterHandler(nextHandler: EditorActionHandler?) : VimKeyHandle | |||||||
| internal class VimEscHandler(nextHandler: EditorActionHandler) : VimKeyHandler(nextHandler) { | internal class VimEscHandler(nextHandler: EditorActionHandler) : VimKeyHandler(nextHandler) { | ||||||
|   override val key: String = "<Esc>" |   override val key: String = "<Esc>" | ||||||
|  |  | ||||||
|   override fun isHandlerEnabled(editor: Editor, dataContext: DataContext?): Boolean { |   private val ideaVimSupportDialog | ||||||
|     val ideaVimSupportDialog = |     get() = injector.globalIjOptions().ideavimsupport.contains(IjOptionConstants.ideavimsupport_dialog) | ||||||
|       injector.globalIjOptions().ideavimsupport.contains(IjOptionConstants.ideavimsupport_dialog) |  | ||||||
|    |    | ||||||
|  |   override fun isHandlerEnabled(editor: Editor, dataContext: DataContext?): Boolean { | ||||||
|     return editor.isPrimaryEditor() || |     return editor.isPrimaryEditor() || | ||||||
|       EditorHelper.isFileEditor(editor) && !editor.vim.mode.inNormalMode || |       EditorHelper.isFileEditor(editor) && vimStateNeedsToHandleEscape(editor) || | ||||||
|       ideaVimSupportDialog && !editor.vim.mode.inNormalMode |       ideaVimSupportDialog && vimStateNeedsToHandleEscape(editor) | ||||||
|  |   } | ||||||
|  |    | ||||||
|  |   private fun vimStateNeedsToHandleEscape(editor: Editor): Boolean { | ||||||
|  |     return !editor.vim.mode.inNormalMode || KeyHandler.getInstance().keyHandlerState.mappingState.hasKeys | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -38,6 +38,9 @@ class MappingState: Cloneable { | |||||||
|   val keys: Iterable<KeyStroke> |   val keys: Iterable<KeyStroke> | ||||||
|     get() = keyList |     get() = keyList | ||||||
|    |    | ||||||
|  |   val hasKeys | ||||||
|  |     get() = keyList.isNotEmpty() | ||||||
|  |  | ||||||
|   private var timer = VimTimer(injector.globalOptions().timeoutlen) |   private var timer = VimTimer(injector.globalOptions().timeoutlen) | ||||||
|   private var keyList = mutableListOf<KeyStroke>() |   private var keyList = mutableListOf<KeyStroke>() | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user