Printing from Gedit text editor

There are replies to this question but they are 13 years old. I would like to ask the question again if I may. I needed a text editor which allows me to write “code” without altering the format I downloaded and actually paid for the Gedit in the Microsoft app store. However, I used it and it was OK for what I wanted but, when I printed to my HP laserjet printer, it started to print 160 pages with no preview in the printer selection window. Each page had about 3 lines before it printed the next page. Anybody got any idea what’s going on and have you a fix.