listpick 0.1.15.5__tar.gz → 0.1.15.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of listpick might be problematic. Click here for more details.

Files changed (63) hide show
  1. {listpick-0.1.15.5 → listpick-0.1.15.7}/CHANGELOG.md +6 -0
  2. {listpick-0.1.15.5/src/listpick.egg-info → listpick-0.1.15.7}/PKG-INFO +1 -1
  3. {listpick-0.1.15.5 → listpick-0.1.15.7}/TODO.md +8 -1
  4. {listpick-0.1.15.5 → listpick-0.1.15.7}/setup.py +1 -1
  5. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/listpick_app.py +108 -31
  6. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/utils.py +1 -1
  7. {listpick-0.1.15.5 → listpick-0.1.15.7/src/listpick.egg-info}/PKG-INFO +1 -1
  8. {listpick-0.1.15.5 → listpick-0.1.15.7}/.gitignore +0 -0
  9. {listpick-0.1.15.5 → listpick-0.1.15.7}/LICENSE.txt +0 -0
  10. {listpick-0.1.15.5 → listpick-0.1.15.7}/README.md +0 -0
  11. {listpick-0.1.15.5 → listpick-0.1.15.7}/assets/aria2tui_screenshot.png +0 -0
  12. {listpick-0.1.15.5 → listpick-0.1.15.7}/assets/file_compare.png +0 -0
  13. {listpick-0.1.15.5 → listpick-0.1.15.7}/assets/lpfman.png +0 -0
  14. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/data_generation/list_files.toml +0 -0
  15. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/data_generation/list_files_empty.toml +0 -0
  16. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/data_generation/video_duplicates.toml +0 -0
  17. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/data_generation/video_mediainfo.toml +0 -0
  18. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/input_files/polynomials.tsv +0 -0
  19. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/input_guides/gnuplot_graph.md +0 -0
  20. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/picker/auxiallary_files/2024-25_Premier_League.pkl +0 -0
  21. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/picker/footer_string_example.py +0 -0
  22. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/picker/picker_example.py +0 -0
  23. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/picker/template.py +0 -0
  24. {listpick-0.1.15.5 → listpick-0.1.15.7}/examples/picker/wikipedia_table.py +0 -0
  25. {listpick-0.1.15.5 → listpick-0.1.15.7}/listpick.py +0 -0
  26. {listpick-0.1.15.5 → listpick-0.1.15.7}/requirements.txt +0 -0
  27. {listpick-0.1.15.5 → listpick-0.1.15.7}/setup.cfg +0 -0
  28. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/__init__.py +0 -0
  29. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/__main__.py +0 -0
  30. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/pane/__init__.py +0 -0
  31. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/pane/get_data.py +0 -0
  32. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/pane/pane_functions.py +0 -0
  33. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/pane/pane_utils.py +0 -0
  34. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/ui/__init__.py +0 -0
  35. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/ui/build_help.py +0 -0
  36. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/ui/footer.py +0 -0
  37. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/ui/help_screen.py +0 -0
  38. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/ui/input_field.py +0 -0
  39. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/ui/keys.py +0 -0
  40. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/ui/picker_colours.py +0 -0
  41. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/__init__.py +0 -0
  42. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/clipboard_operations.py +0 -0
  43. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/config.py +0 -0
  44. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/dump.py +0 -0
  45. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/filtering.py +0 -0
  46. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/generate_data.py +0 -0
  47. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/graphing.py +0 -0
  48. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/keycodes.py +0 -0
  49. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/options_selectors.py +0 -0
  50. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/paste_operations.py +0 -0
  51. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/picker_log.py +0 -0
  52. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/search_and_filter_utils.py +0 -0
  53. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/searching.py +0 -0
  54. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/sorting.py +0 -0
  55. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/table_to_list_of_lists.py +0 -0
  56. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick/utils/user_input.py +0 -0
  57. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick.egg-info/SOURCES.txt +0 -0
  58. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick.egg-info/dependency_links.txt +0 -0
  59. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick.egg-info/entry_points.txt +0 -0
  60. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick.egg-info/requires.txt +0 -0
  61. {listpick-0.1.15.5 → listpick-0.1.15.7}/src/listpick.egg-info/top_level.txt +0 -0
  62. {listpick-0.1.15.5 → listpick-0.1.15.7}/tests/kitty_control.sh +0 -0
  63. {listpick-0.1.15.5 → listpick-0.1.15.7}/tests/sorting_dates.csv +0 -0
@@ -1,6 +1,12 @@
1
1
  # CHANGELOG.md
2
2
  Note that the changes between 0.1.11.0 and 1.1.12.0 are listed under 0.1.11
3
3
 
4
+ ## [0.1.15.7] 2025-07-28
5
+ - Fixed header column alignment problems which popped up with some datasets.
6
+
7
+ ## [0.1.15.6] 2025-07-27
8
+ - Fixed misaligned header with very long header values.
9
+
4
10
  ## [0.1.15.4] 2025-07-27
5
11
  - Fixed error with filtering when there are no rows (i.e., items=[[]])
6
12
  - Fixed error with changing modes when there are no rows (i.e., items=[[]]).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.15.5
3
+ Version: 0.1.15.7
4
4
  Summary: Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.
5
5
  Home-page: https://github.com/grimandgreedy/listpick
6
6
  Author: Grim
@@ -1,7 +1,7 @@
1
1
  # TODO for listpick
2
2
 
3
3
 
4
- ASAP
4
+ > [!IMPORTANT] ASAP
5
5
  > - [ ] Unify in-app load and command-line input file
6
6
  > - [ ] Implement default_option_selector and pass the picker options (!!!)
7
7
  > - [ ] Make sure that all class initialisation variables are returned in the get_function_variables function.
@@ -23,6 +23,11 @@ ASAP
23
23
  > - [x] Arrow keys
24
24
  > - [x] Add new keycodes to build_help().
25
25
  > - [ ] Search count is off
26
+ > - [x] Cell isn't highlighted properly when cell beginning is offscreen
27
+ > - [x] ~/items.csv
28
+ > - [x] Selected column isn't highlighted properly when cell beginning is offscreen
29
+ > - [x] Header rows not aligned properly sometimes...
30
+ > - [ ] Check leftmost_char after resizing
26
31
 
27
32
 
28
33
 
@@ -381,6 +386,8 @@ ASAP
381
386
  > - [x] Highlighted cells display padded cell string when it should not be padded.
382
387
  > - [x] When there is an active search it overlaps the last row.
383
388
  > - [x] Update footer height when there is a search query.
389
+ > - [x] Header columns are not aligned with long header values.
390
+ > - [x] Done: 2025-08-27
384
391
 
385
392
 
386
393
 
@@ -16,7 +16,7 @@ with open("README.md", "r", encoding = "utf-8") as fh:
16
16
 
17
17
  setuptools.setup(
18
18
  name = "listpick",
19
- version = "0.1.15.5",
19
+ version = "0.1.15.7",
20
20
  author = "Grim",
21
21
  author_email = "grimandgreedy@protonmail.com",
22
22
  description = "Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.",
@@ -866,7 +866,11 @@ class Picker:
866
866
  number = f"{i}. " if self.number_columns else ""
867
867
  # number = f"{intStringToExponentString(str(i))}. " if self.number_columns else ""
868
868
  header_str += number
869
- header_str += f"{self.header[i]:^{self.column_widths[i]-len(number)}}"
869
+ # header_str += f"{self.header[i]:^{self.column_widths[i]-len(number)}}"
870
+ col_str = self.header[i][:self.column_widths[i]-len(number)]
871
+
872
+
873
+ header_str += f"{col_str:^{self.column_widths[i]-len(number)}}"
870
874
  header_str += self.separator
871
875
 
872
876
  header_str = header_str[self.leftmost_char:]
@@ -877,15 +881,69 @@ class Picker:
877
881
  # Highlight sort column
878
882
  try:
879
883
  if self.selected_column != None and self.selected_column not in self.hidden_columns:
880
- if len(self.header) > 1 and (len(up_to_selected_col)-self.leftmost_char) < self.rows_w:
881
- number = f"{self.selected_column}. " if self.number_columns else ""
882
- # number = f"{intStringToExponentString(self.selected_column)}. " if self.number_columns else ""
883
- # self.startx + len(up_to_selected_col) - self.leftmost_char
884
- highlighed_col_startx = max(self.startx, self.startx + len(up_to_selected_col) - self.leftmost_char)
885
- highlighted_col_str = (number+f"{self.header[self.selected_column]:^{self.column_widths[self.selected_column]-len(number)}}") + self.separator
886
- end_of_highlighted_col_str = self.rows_w-(highlighed_col_startx+len(highlighted_col_str)) if (highlighed_col_startx+len(highlighted_col_str)) > self.rows_w else len(highlighted_col_str)
887
- start_of_highlighted_col_str = max(self.leftmost_char - len(up_to_selected_col), 0)
888
- self.stdscr.addstr(header_ypos, highlighed_col_startx , highlighted_col_str[start_of_highlighted_col_str:end_of_highlighted_col_str], curses.color_pair(self.colours_start+19) | curses.A_BOLD)
884
+ # start of string is on screen
885
+ col_width = self.column_widths[self.selected_column]
886
+ number = f"{self.selected_column}. " if self.number_columns else ""
887
+ col_str = self.header[self.selected_column][:self.column_widths[self.selected_column]-len(number)]
888
+ highlighted_col_str = (number+f"{col_str:^{self.column_widths[self.selected_column]-len(number)}}") + self.separator
889
+
890
+ # Start of selected column is on the screen
891
+ if self.leftmost_char <= len(up_to_selected_col) and self.leftmost_char+self.rows_w-self.startx > len(up_to_selected_col):
892
+ x_pos = len(up_to_selected_col) - self.leftmost_char + self.startx
893
+
894
+ # Whole cell of the selected column is on the screen
895
+ if len(up_to_selected_col)+col_width - self.leftmost_char < self.rows_w-self.startx:
896
+ disp_str = highlighted_col_str
897
+
898
+ # Start of the cell is on the screen, but the end of the cell is not
899
+ else:
900
+ overflow = (len(up_to_selected_col)+len(highlighted_col_str)) - (self.leftmost_char+self.rows_w - self.startx)
901
+ disp_str = highlighted_col_str[:-overflow]
902
+
903
+ self.stdscr.addstr(header_ypos, x_pos , disp_str, curses.color_pair(self.colours_start+19) | curses.A_BOLD)
904
+ # Start of the cell is to the right of the screen
905
+ elif self.leftmost_char+self.rows_w <= len(up_to_selected_col):
906
+ pass
907
+ # The end of the cell is on the screen, the start of the cell is not
908
+ elif 0 <= len(up_to_selected_col)+col_width - self.leftmost_char <= self.rows_w :
909
+ x_pos = self.startx
910
+ beg = self.leftmost_char - len(up_to_selected_col)
911
+ disp_str = highlighted_col_str[beg:]
912
+ self.stdscr.addstr(header_ypos, x_pos , disp_str, curses.color_pair(self.colours_start+19) | curses.A_BOLD)
913
+ # The middle of the cell is on the screen, the start and end of the cell are not
914
+ elif self.leftmost_char <= len(up_to_selected_col) + col_width//2 <= self.leftmost_char+self.rows_w:
915
+ beg = self.leftmost_char - len(up_to_selected_col)
916
+ overflow = (len(up_to_selected_col)+len(highlighted_col_str)) - (self.leftmost_char+self.rows_w)
917
+ disp_str = highlighted_col_str[beg:-overflow]
918
+
919
+ x_pos = self.startx
920
+ self.stdscr.addstr(header_ypos, x_pos , disp_str, curses.color_pair(self.colours_start+19) | curses.A_BOLD)
921
+ # The cell is to the left of the screen
922
+ else:
923
+ pass
924
+
925
+ # elif self.leftmost_char:
926
+ # os.system(f"notify-send 'cell is to the right of the screen'")
927
+
928
+ #
929
+ #
930
+ # if len(self.header) > 1 and (len(up_to_selected_col)-self.leftmost_char) < self.rows_w:
931
+ # number = f"{self.selected_column}. " if self.number_columns else ""
932
+ # # number = f"{intStringToExponentString(self.selected_column)}. " if self.number_columns else ""
933
+ # # self.startx + len(up_to_selected_col) - self.leftmost_char
934
+ # highlighed_col_startx = max(self.startx, self.startx + len(up_to_selected_col) - self.leftmost_char)
935
+ #
936
+ #
937
+ # col_str = self.header[self.selected_column][:self.column_widths[self.selected_column]-len(number)]
938
+ # highlighted_col_str = (number+f"{col_str:^{self.column_widths[self.selected_column]}}") + self.separator
939
+ # end_of_highlighted_col_str = self.rows_w-(highlighed_col_startx+len(highlighted_col_str)) if (highlighed_col_startx+len(highlighted_col_str)) > self.rows_w else len(highlighted_col_str)
940
+ # if (highlighed_col_startx+len(highlighted_col_str)) > self.rows_w:
941
+ # end_of_highlighted_col_str = self.rows_w-(highlighed_col_startx+len(highlighted_col_str))
942
+ # else:
943
+ # end_of_highlighted_col_str = len(highlighted_col_str)
944
+ #
945
+ # start_of_highlighted_col_str = max(self.leftmost_char - len(up_to_selected_col), 0)
946
+ # self.stdscr.addstr(header_ypos, highlighed_col_startx , highlighted_col_str[start_of_highlighted_col_str:end_of_highlighted_col_str][:self.column_widths[self.selected_column]+len(self.separator)], curses.color_pair(self.colours_start+19) | curses.A_BOLD)
889
947
  except:
890
948
  pass
891
949
 
@@ -898,11 +956,14 @@ class Picker:
898
956
  else:
899
957
  self.stdscr.addstr(y, 0, f" {self.indexed_items[idx][0]} ", curses.color_pair(self.colours_start+4) | curses.A_BOLD)
900
958
 
901
- def highlight_cell(row: int, col:int, visible_column_widths, colour_pair_number: int = 5):
959
+
960
+ def highlight_cell(row: int, col:int, visible_column_widths, colour_pair_number: int = 5, y:int = 0):
961
+
902
962
  cell_pos = sum(visible_column_widths[:col])+col*len(self.separator)-self.leftmost_char + self.startx
903
963
  # cell_width = self.column_widths[self.selected_column]
904
964
  cell_width = visible_column_widths[col] + len(self.separator)
905
965
  cell_max_width = self.rows_w-cell_pos
966
+
906
967
  try:
907
968
  # Start of cell is on screen
908
969
  if self.startx <= cell_pos <= self.rows_w:
@@ -912,17 +973,23 @@ class Picker:
912
973
  else:
913
974
  cell_value = self.indexed_items[row][1][col] + self.separator
914
975
  # cell_value = cell_value[:min(cell_width, cell_max_width)-len(self.separator)]
915
- cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width)-len(self.separator), self.centre_in_cols, self.unicode_char_width)
916
- cell_value = cell_value + self.separator
976
+ cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width), self.centre_in_cols, self.unicode_char_width)
977
+ # cell_value = cell_value + self.separator
917
978
  # cell_value = cell_value
918
979
  cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width), self.centre_in_cols, self.unicode_char_width)
919
980
  self.stdscr.addstr(y, cell_pos, cell_value, curses.color_pair(self.colours_start+colour_pair_number) | curses.A_BOLD)
920
981
  # Part of the cell is on screen
921
- elif self.startx <= cell_pos+cell_width <= self.rows_w:
982
+ elif self.startx <= cell_pos+cell_width and cell_pos < (self.rows_w):
922
983
  cell_start = self.startx - cell_pos
923
- self.stdscr.addstr(y, self.startx, ' '*(cell_width-cell_start), curses.color_pair(self.colours_start+colour_pair_number))
924
- cell_value = self.indexed_items[row][1][col][cell_start:visible_column_widths[col]]
984
+ # self.stdscr.addstr(y, self.startx, ' '*(cell_width-cell_start), curses.color_pair(self.colours_start+colour_pair_number))
985
+ cell_value = self.indexed_items[row][1][col]
986
+ cell_value = f"{cell_value:^{self.column_widths[col]}}"
987
+
988
+ cell_value = cell_value[cell_start:visible_column_widths[col]][:self.rows_w-self.startx]
925
989
  self.stdscr.addstr(y, self.startx, cell_value, curses.color_pair(self.colours_start+colour_pair_number) | curses.A_BOLD)
990
+ else:
991
+ pass
992
+ # if colour_pair_number == 5:
926
993
  except:
927
994
  pass
928
995
 
@@ -1005,7 +1072,17 @@ class Picker:
1005
1072
  # row_str = truncate_to_display_width(row_str, min(w-self.startx, visible_columns_total_width))
1006
1073
  row_str_orig = format_row(item[1], self.hidden_columns, self.column_widths, self.separator, self.centre_in_cols, self.unicode_char_width)
1007
1074
  row_str_left_adj = clip_left(row_str_orig, self.leftmost_char)
1008
- row_str = truncate_to_display_width(row_str_left_adj, min(self.rows_w-self.startx, visible_columns_total_width), self.unicode_char_width)
1075
+ # rowstr off screen
1076
+ # if self.leftmost_char > len(row_str_orig):
1077
+ # trunc_width = 0
1078
+ if self.leftmost_char + (self.rows_w-self.startx) <= len(row_str_orig):
1079
+ trunc_width = self.rows_w-self.startx
1080
+ elif self.leftmost_char <= len(row_str_orig):
1081
+ trunc_width = len(row_str_orig) - self.leftmost_char
1082
+ else:
1083
+ trunc_width = 0
1084
+
1085
+ row_str = truncate_to_display_width(row_str_left_adj, trunc_width, self.unicode_char_width)
1009
1086
  # row_str = truncate_to_display_width(row_str, min(w-self.startx, visible_columns_total_width))[self.leftmost_char:]
1010
1087
 
1011
1088
  ## Display the standard row
@@ -1021,21 +1098,21 @@ class Picker:
1021
1098
  # self.selected_cells_by_row = get_selected_cells_by_row(self.cell_selections)
1022
1099
  if item[0] in self.selected_cells_by_row:
1023
1100
  for j in self.selected_cells_by_row[item[0]]:
1024
- highlight_cell(idx, j, visible_column_widths, colour_pair_number=25)
1101
+ highlight_cell(idx, j, visible_column_widths, colour_pair_number=25, y=y)
1025
1102
 
1026
1103
  # Visually selected
1027
1104
  if self.is_selecting:
1028
1105
  if self.start_selection <= idx <= self.cursor_pos or self.start_selection >= idx >= self.cursor_pos:
1029
1106
  x_interval = range(min(self.start_selection_col, self.selected_column), max(self.start_selection_col, self.selected_column)+1)
1030
1107
  for col in x_interval:
1031
- highlight_cell(idx, col, visible_column_widths, colour_pair_number=25)
1108
+ highlight_cell(idx, col, visible_column_widths, colour_pair_number=25, y=y)
1032
1109
 
1033
1110
  # Visually deslected
1034
1111
  if self.is_deselecting:
1035
1112
  if self.start_selection >= idx >= self.cursor_pos or self.start_selection <= idx <= self.cursor_pos:
1036
1113
  x_interval = range(min(self.start_selection_col, self.selected_column), max(self.start_selection_col, self.selected_column)+1)
1037
1114
  for col in x_interval:
1038
- highlight_cell(idx, col, visible_column_widths, colour_pair_number=26)
1115
+ highlight_cell(idx, col, visible_column_widths, colour_pair_number=26, y=y)
1039
1116
  # Higlight cursor row and selected rows
1040
1117
  elif self.highlight_full_row:
1041
1118
  if self.selections[item[0]]:
@@ -1068,7 +1145,7 @@ class Picker:
1068
1145
  # Draw cursor
1069
1146
  if idx == self.cursor_pos:
1070
1147
  if self.cell_cursor:
1071
- highlight_cell(idx, self.selected_column, visible_column_widths)
1148
+ highlight_cell(idx, self.selected_column, visible_column_widths, colour_pair_number=5, y=y)
1072
1149
  else:
1073
1150
  self.stdscr.addstr(y, self.startx, row_str[:min(self.rows_w-self.startx, visible_columns_total_width)], curses.color_pair(self.colours_start+5) | curses.A_BOLD)
1074
1151
 
@@ -1113,7 +1190,7 @@ class Picker:
1113
1190
  self.stdscr.addstr(self.term_h - 1, self.term_w-footer_string_width-1, f"{disp_string}", curses.color_pair(self.colours_start+24))
1114
1191
 
1115
1192
  if self.split_right and self.split_right_function(self.stdscr, 0,0,0,0,{},[],[],"",test=True):
1116
- self.right_pane_previous_data = self.split_right_function(
1193
+ self.split_right_function(
1117
1194
  self.stdscr,
1118
1195
  x = self.rows_w,
1119
1196
  y = self.top_space - int(bool(self.show_header and self.header)),
@@ -2866,8 +2943,8 @@ class Picker:
2866
2943
  self.logger.info(f"key_function scroll_right")
2867
2944
  if len(self.indexed_items):
2868
2945
  row_width = sum(self.column_widths) + len(self.separator)*(len(self.column_widths)-1)
2869
- if row_width-self.leftmost_char >= self.rows_w-self.startx:
2870
- self.leftmost_char = self.leftmost_char+5
2946
+ if row_width-self.leftmost_char >= self.rows_w-self.startx-5:
2947
+ self.leftmost_char += 5
2871
2948
 
2872
2949
  elif self.check_key("scroll_left", key, self.keys_dict):
2873
2950
  self.logger.info(f"key_function scroll_left")
@@ -2881,17 +2958,18 @@ class Picker:
2881
2958
  elif self.check_key("scroll_far_right", key, self.keys_dict):
2882
2959
  self.logger.info(f"key_function scroll_far_right")
2883
2960
  longest_row_str_len = 0
2884
- rows = self.get_visible_rows()
2885
- for i in range(len(rows)):
2886
- item = rows[i]
2887
- row_str = format_row(item, self.hidden_columns, self.column_widths, self.separator, self.centre_in_cols, self.unicode_char_width)
2888
- if len(row_str) > longest_row_str_len: longest_row_str_len=len(row_str)
2961
+ # rows = self.get_visible_rows()
2962
+ # for i in range(len(rows)):
2963
+ # item = rows[i]
2964
+ # row_str = format_row(item, self.hidden_columns, self.column_widths, self.separator, self.centre_in_cols, self.unicode_char_width)
2965
+ # if len(row_str) > longest_row_str_len: longest_row_str_len=len(row_str)
2966
+ longest_row_str_len = sum(self.column_widths) + (len(self.column_widths)-1)*len(self.separator)
2889
2967
  # for i in range(len(self.indexed_items)):
2890
2968
  # item = self.indexed_items[i]
2891
2969
  # row_str = format_row(item[1], self.hidden_columns, self.column_widths, self.separator, self.centre_in_cols)
2892
2970
  # if len(row_str) > longest_row_str_len: longest_row_str_len=len(row_str)
2893
2971
  # self.notification(self.stdscr, f"{longest_row_str_len}")
2894
- self.leftmost_char = max(0, longest_row_str_len-self.rows_w+2+self.startx)
2972
+ self.leftmost_char = max(0, longest_row_str_len-self.rows_w+2+self.startx+5)
2895
2973
  if len(self.items):
2896
2974
  self.selected_column = len(self.items[0])-1
2897
2975
 
@@ -2986,7 +3064,6 @@ class Picker:
2986
3064
 
2987
3065
  self.calculate_section_sizes()
2988
3066
  self.column_widths = get_column_widths(self.items, header=self.header, max_column_width=self.max_column_width, number_columns=self.number_columns, max_total_width=self.rows_w, unicode_char_width=self.unicode_char_width)
2989
-
2990
3067
  self.draw_screen(self.indexed_items, self.highlights)
2991
3068
 
2992
3069
 
@@ -34,7 +34,7 @@ def clip_left(text, n):
34
34
  if width + char_width > n:
35
35
  return text[i:]
36
36
  width += char_width
37
- return text # If the total width is less than n, return the full string
37
+ return ""
38
38
 
39
39
  def truncate_to_display_width(text: str, max_column_width: int, centre=False, unicode_char_width: bool = True) -> str:
40
40
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.15.5
3
+ Version: 0.1.15.7
4
4
  Summary: Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.
5
5
  Home-page: https://github.com/grimandgreedy/listpick
6
6
  Author: Grim
File without changes
File without changes
File without changes
File without changes
File without changes