##// END OF EJS Templates
Add three new commands to the input mode for "find" and friends:...
walter.doerwald -
Show More
@@ -476,11 +476,14 b' class _CommandInput(object):'
476 127: "backspace",
476 127: "backspace",
477 curses.KEY_BACKSPACE: "backspace",
477 curses.KEY_BACKSPACE: "backspace",
478 curses.KEY_DC: "delete",
478 curses.KEY_DC: "delete",
479 ord("x"): "delete",
479 # CTRL-K
480 0x0B: "delend",
480 ord("\n"): "execute",
481 ord("\n"): "execute",
481 ord("\r"): "execute",
482 ord("\r"): "execute",
482 curses.KEY_UP: "up",
483 curses.KEY_UP: "up",
483 curses.KEY_DOWN: "down",
484 curses.KEY_DOWN: "down",
485 curses.KEY_PPAGE: "incsearchup",
486 curses.KEY_NPAGE: "incsearchdown",
484 # CTRL-X
487 # CTRL-X
485 0x18: "exit",
488 0x18: "exit",
486 }
489 }
@@ -537,6 +540,11 b' class _CommandInput(object):'
537 else:
540 else:
538 curses.beep()
541 curses.beep()
539
542
543 def cmd_delend(self, browser):
544 if self.curx<len(self.input):
545 self.input = self.input[:self.curx]
546 return True
547
540 def cmd_left(self, browser):
548 def cmd_left(self, browser):
541 if self.curx:
549 if self.curx:
542 self.curx -= 1
550 self.curx -= 1
@@ -586,6 +594,32 b' class _CommandInput(object):'
586 else:
594 else:
587 curses.beep()
595 curses.beep()
588
596
597 def cmd_incsearchup(self, browser):
598 prefix = self.input[:self.curx]
599 cury = self.cury
600 while True:
601 cury += 1
602 if cury >= len(self.history):
603 break
604 if self.history[cury].startswith(prefix):
605 self.input = self.history[cury]
606 self.cury = cury
607 return True
608 curses.beep()
609
610 def cmd_incsearchdown(self, browser):
611 prefix = self.input[:self.curx]
612 cury = self.cury
613 while True:
614 cury -= 1
615 if cury <= 0:
616 break
617 if self.history[cury].startswith(prefix):
618 self.input = self.history[self.cury]
619 self.cury = cury
620 return True
621 curses.beep()
622
589 def cmd_exit(self, browser):
623 def cmd_exit(self, browser):
590 browser.mode = "default"
624 browser.mode = "default"
591 return True
625 return True
@@ -5,7 +5,12 b''
5 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
5 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
6 attributes again. Remapped the help command to "?". Display
6 attributes again. Remapped the help command to "?". Display
7 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
7 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
8 as keys for the "home" and "end" commands.
8 as keys for the "home" and "end" commands. Add three new commands
9 to the input mode for "find" and friends: "delend" (CTRL-K)
10 deletes to the end of line. "incsearchup" searches upwards in the
11 command history for an input that starts with the text before the cursor.
12 "incsearchdown" does the same downwards. Removed a bogus mapping of
13 the x key to "delete".
9
14
10 2006-06-15 Ville Vainio <vivainio@gmail.com>
15 2006-06-15 Ville Vainio <vivainio@gmail.com>
11
16
General Comments 0
You need to be logged in to leave comments. Login now