Skip to content

Commit

Permalink
fix: move Gui.cmd.get_command_parts() outside the loop
Browse files Browse the repository at this point in the history
`Gui.cmd.get_command_parts()`  is inside a loop but calls a method that likely returns the same result in each iteration
  • Loading branch information
RealHurrison authored Apr 25, 2024
1 parent 4c98b07 commit f94ace6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arsenal/modules/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ def get_nb_preview_new_lines(self):
nblines = 0
multiline = '\n' in Gui.cmd.cmdline
firstline = True
parts = Gui.cmd.get_command_parts()
nb_args_todo = len(parts) - 1
# in case of multiline cmd process each line separately
# for each line we have to count each char and deduce the
# number of lines needed to print it
for line in Gui.cmd.cmdline.split('\n'):
parts = Gui.cmd.get_command_parts()
nb_args_todo = len(parts) - 1
nbchar = 0

# for all lines except the first one we have ' >' in addition
Expand Down

0 comments on commit f94ace6

Please sign in to comment.