Show More
@@ -1079,6 +1079,8 b' def movecursor(state, oldpos, newpos):' | |||||
1079 | def changemode(state, mode): |
|
1079 | def changemode(state, mode): | |
1080 | curmode, _ = state['mode'] |
|
1080 | curmode, _ = state['mode'] | |
1081 | state['mode'] = (mode, curmode) |
|
1081 | state['mode'] = (mode, curmode) | |
|
1082 | if mode == MODE_PATCH: | |||
|
1083 | state['modes'][MODE_PATCH]['patchcontents'] = patchcontents(state) | |||
1082 |
|
1084 | |||
1083 | def makeselection(state, pos): |
|
1085 | def makeselection(state, pos): | |
1084 | state['selected'] = pos |
|
1086 | state['selected'] = pos | |
@@ -1134,7 +1136,7 b' def changeview(state, delta, unit):' | |||||
1134 | if mode != MODE_PATCH: |
|
1136 | if mode != MODE_PATCH: | |
1135 | return |
|
1137 | return | |
1136 | mode_state = state['modes'][mode] |
|
1138 | mode_state = state['modes'][mode] | |
1137 |
num_lines = len(patchcontents |
|
1139 | num_lines = len(mode_state['patchcontents']) | |
1138 | page_height = state['page_height'] |
|
1140 | page_height = state['page_height'] | |
1139 | unit = page_height if unit == 'page' else 1 |
|
1141 | unit = page_height if unit == 'page' else 1 | |
1140 | num_pages = 1 + (num_lines - 1) / page_height |
|
1142 | num_pages = 1 + (num_lines - 1) / page_height | |
@@ -1394,7 +1396,8 b' pgup/K: move patch up, pgdn/J: move patc' | |||||
1394 |
|
1396 | |||
1395 | def renderpatch(win, state): |
|
1397 | def renderpatch(win, state): | |
1396 | start = state['modes'][MODE_PATCH]['line_offset'] |
|
1398 | start = state['modes'][MODE_PATCH]['line_offset'] | |
1397 | renderstring(win, state, patchcontents(state)[start:], diffcolors=True) |
|
1399 | content = state['modes'][MODE_PATCH]['patchcontents'] | |
|
1400 | renderstring(win, state, content[start:], diffcolors=True) | |||
1398 |
|
1401 | |||
1399 | def layout(mode): |
|
1402 | def layout(mode): | |
1400 | maxy, maxx = stdscr.getmaxyx() |
|
1403 | maxy, maxx = stdscr.getmaxyx() |
General Comments 0
You need to be logged in to leave comments.
Login now