Skip to content

Commit

Permalink
don't remember previous cursor location on removing filter
Browse files Browse the repository at this point in the history
more responsive ui (with threading) breaks this since the cursor
resets to the first row as the entries load
  • Loading branch information
elesiuta committed Aug 17, 2023
1 parent 16a9a1a commit dde20ab
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions picosnitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,6 @@ def get_geoip(ip: str) -> str:
max_y, max_x = stdscr.getmaxyx()
first_line = 4
cursor, line = first_line, first_line
saved_cursors = []
filter_values = []
add_filter = False
update_query = True
Expand Down Expand Up @@ -1540,9 +1539,6 @@ def get_geoip(ip: str) -> str:
if tab_i not in tab_stack:
tab_stack.append(tab_i)
filter_values.append(name)
else:
# already filtering on this column, clean up cursor stack so stack sizes match
_ = saved_cursors.pop()
break
else:
stdscr.attrset(curses.color_pair(0))
Expand Down Expand Up @@ -1593,13 +1589,10 @@ def get_geoip(ip: str) -> str:
# process user input
if ch == ord("\n") or ch == ord(" "):
add_filter = True
saved_cursors.append(cursor)
elif ch == curses.KEY_BACKSPACE:
if tab_stack:
tab_i = tab_stack.pop()
_ = filter_values.pop()
cursor = saved_cursors.pop()
line = cursor + 1
update_query = True
execute_query = True
elif ch == ord("r"):
Expand Down

0 comments on commit dde20ab

Please sign in to comment.