Skip to content

If `-l LINE` is used to open file then all subsequent invocations without -l focuse cursor on LINE--

Hello!

Steps to reproduce:

$ mousepad -l 6 -c 2 foo.txt
$ mousepad bar.txt
$ mousepad foobar.txt

Mousepad opens foo.txt focusing cursor on line 6 as expected but opens bar.txt focusing cursor on line 5 and foobar.txt focusing cursor on line 4 which is not expected.

I think this is happening because we are decreasing application->line once it's set https://gitlab.xfce.org/apps/mousepad/-/blob/master/mousepad/mousepad-application.c#L762

I think the fix can be to only decrease line if there was a -l/--line switch used on commandline. Anyways, I'll look into it in the evening.

Edited by Avinash Sonawane