Permalink
Browse files

Fix bug when using ime

  • Loading branch information...
uk-ar committed Aug 6, 2013
1 parent 6bac93e commit dbb048f853f0197a7ed26c16e98d322b14e7e59b
Showing with 15 additions and 5 deletions.
  1. +15 −5 key-combo.el
View
@@ -112,14 +112,15 @@
;; Code goes here
(require 'cl)
;; for remove-if
(defvar key-combo-debug nil)
(defun key-combo-describe ()
"List key combo bindings in a help buffer."
(interactive)
(describe-bindings [key-combo]))
;; (mac-input-source-is-ascii-capable)
(defun key-combo-make-key-vector (key)
"Return vector
key is sequences"
@@ -392,14 +393,17 @@ which in most cases is shared with all other buffers in the same major mode.
;; Let the debugger run
((debug error) (signal (car err) (cdr err)))))
;;input-method-function
(defun key-combo-post-command-function ()
(let* ((echo-keystrokes 0)
(this-command nil)
(in-key-combo (eq 'key-combo
(if (< 0 (length (this-command-keys-vector)))
(aref (this-command-keys-vector) 0))))
(keys-vector (if in-key-combo (key-combo-keys-vector) nil))
(events (vector (read-event))))
(events (vector (read-key)))
)
(cond
;; finish:disabled modes
((or (not key-combo-mode)
@@ -553,7 +557,8 @@ which in most cases is shared with all other buffers in the same major mode.
("=*" . " =* ") ;for c
("+" . (" + " "++"))
("+=" . " += ")
("-" . (" - " "--")) ;undo when unary operator
;; ("-" . (" - " "--")) ;undo when unary operator
("-" . ("-" "--")) ;abuse in regexp
("-=" . " -= ")
("->" . " -> ");; for haskell,coffee script. overwrite in c
(">" . (key-combo-execute-original " >> "))
@@ -573,7 +578,7 @@ which in most cases is shared with all other buffers in the same major mode.
("!~" . " !~ ") ; for ruby
("~" . key-combo-execute-original)
;; for unary operator
("::" . " :: ") ;; for haskell
;; ("::" . " :: ") ;; for haskell not in ruby
;; (":" . ":");;for ruby symbol
("&" . (" & " " && ")) ;overwrite in c
("&=" . " &= ");; for c
@@ -609,6 +614,11 @@ which in most cases is shared with all other buffers in the same major mode.
"Default binding which enabled by `key-combo-common-mode-hooks'"
:group 'key-combo)
;; rhtml-mode
;; <% rinari-insert-erb-skeleton
;; (key-combo-define-local "<%" 'rinari-insert-erb-skeleton)
;; (key-combo-define-local ":" ":")
(defcustom key-combo-org-default
'(("C-a" . (org-beginning-of-line
beginning-of-buffer
@@ -681,7 +691,7 @@ which in most cases is shared with all other buffers in the same major mode.
makefile-mode-hook
js2-mode-hook)
'key-combo-property-default
'((":" . ": ")))
'((":" . ":")));; not work in erb
;; align is better for property?
)

0 comments on commit dbb048f

Please sign in to comment.