Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Open file from command line BUG FIX PATCH

(1/2) > >>

daniloz:
Hi All,

I've found a bug when opening a file and jumping to a line from command line. It occurs if the file is already open in C::B, but it's not the last file opened, so steps to reproduce it:

1- open C::B ;-)
2- open file A
3- open file B
4- run codeblocks.exe --file=file_A:20
5- file A has the focus, but the cursor of file B is at line 20 and not the one of file A

The bug is straightforward to see and it's corrected in the patch attached.

This patch also maximize the C::B window in case it's minimized, before raising it. (related to http://forums.codeblocks.org/index.php/topic,14517.0.html)

oBFusCATed:
The bug is confirmed, on linux, too...I'll test the patch in a minute

p.s. The general rule is to not mix unrelated changes in a single patch, thus it minimizes the work the people testing the patch have to do...

daniloz:

--- Quote from: oBFusCATed on May 24, 2012, 07:43:59 pm ---p.s. The general rule is to not mix unrelated changes in a single patch, thus it minimizes the work the people testing the patch have to do...

--- End quote ---
Sorry about that... :-)

I was so excited that I solved both "problems" that I wanted to share it asap...

Should I break the patch into two?

oBFusCATed:
No, I doubt that forcing the maximizing is the right thing to do, but you should provide a patch there, where the context is correct.

I'll commit your --file patch in a minute... Done...

MortenMacFly:
Btw: Instead of IsMaximized() you should check for !IsIconised() and issue a Show() then... IMHO that's the better option. Notice the Iconised, not Iconized... ;-)

But what was actually the bug here?

Navigation

[0] Message Index

[#] Next page

Go to full version