| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 72de2a5 commit 171eb8e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,6 +71,7 @@ | |||
| 71 | 71 | from bpython.keys import key_dispatch | |
| 72 | 72 | ||
| 73 | 73 | from bpython import __version__ | |
| 74 | + from bpython.pager import page | ||
| 74 | 75 | ||
| 75 | 76 | def log(x): | |
| 76 | 77 | f = open('/tmp/bpython.log', 'a') | |
@@ -481,6 +482,7 @@ def __init__(self, scr, interp, statusbar=None, idle=None): | |||
| 481 | 482 | self.paste_mode = False | |
| 482 | 483 | self.last_key_press = time.time() | |
| 483 | 484 | self.paste_time = 0.02 | |
| 485 | + self.prev_block_finished = 0 | ||
| 484 | 486 | sys.path.insert(0, '.') | |
| 485 | 487 | ||
| 486 | 488 | if not OPTS.arg_spec: | |
@@ -1265,8 +1267,10 @@ def repl(self): | |||
| 1265 | 1267 | # Keep two copies so you can go up and down in the hist: | |
| 1266 | 1268 | if inp: | |
| 1267 | 1269 | self.rl_hist.append(inp + '\n') | |
| 1270 | + stdout_position = len(self.stdout_hist) | ||
| 1268 | 1271 | more = self.push(inp) or self.paste_mode | |
| 1269 | 1272 | if not more: | |
| 1273 | + self.prev_block_finished = stdout_position | ||
| 1270 | 1274 | self.s = '' | |
| 1271 | 1275 | ||
| 1272 | 1276 | def size(self): | |
@@ -1585,6 +1589,10 @@ def p_key(self): | |||
| 1585 | 1589 | self.pastebin() | |
| 1586 | 1590 | return '' | |
| 1587 | 1591 | ||
| 1592 | + elif self.c in key_dispatch[OPTS.last_output_key]: | ||
| 1593 | + page(self.stdout_hist[self.prev_block_finished:-4]) | ||
| 1594 | + return '' | ||
| 1595 | + | ||
| 1588 | 1596 | elif self.c == '\n': | |
| 1589 | 1597 | self.lf() | |
| 1590 | 1598 | return None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,6 +70,7 @@ def loadini(struct, configfile): | |||
| 70 | 70 | struct.clear_line_key = config.safeget('keyboard', 'clear_line', 'C-u') | |
| 71 | 71 | struct.clear_screen_key = config.safeget('keyboard', 'clear_screen', 'C-l') | |
| 72 | 72 | struct.exit_key = config.safeget('keyboard', 'exit', 'C-d') | |
| 73 | + struct.last_output_key = config.safeget('keyboard', 'last_output', 'F9') | ||
| 73 | 74 | ||
| 74 | 75 | color_scheme_name = config.safeget('general', 'color_scheme', 'default') | |
| 75 | 76 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments