Python Forum

Full Version: debugging help on Visual Studio Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi Team,

I want to take cursor to previous line on visual studio code editor.
tried on pycharm also it didn't worked.

Can we jump back to previous line.?...


Attached Snapshot of code.
You cannot go to a previous line in any debugger that I am aware of. If you want to stop on the previous line, set a beakpoint on the previous line and re-run.
Hi Deanhystad,

Thanks for the info,

Actually I come from VBA Background , excel automation via Macro. there that option was there hence asked.


Thanks
mg
Can use Debug: Jump to Cursor command in command ctrl+shift+p
Click on desired line and use this command the debug will jump to line where cursor is placed.
Hi snippsat ,

When clicked ctrl+shift+p ,

cursor is not moving to backword,
only I am getting pop window of command palate


Cursor was at line 16 and

I wanted to move to line 14, using ctrl+shift+p its not working. I am using Visual Studio Code.


Thanks
mg
That is what you should get. Then you have to select Debug: Jump to cursor in the command palette.
highlight target line, then click ctrl+shift+p
Maybe it is just semantics, but I don't think jump to cursor can be used to go back to the previous command. Jump to cursor just sets the program counter. It doesn't undo the command, giving me a view of the program state prior to executing the previous command. If the previous command was "x = x + 1" and x is currently 5, jumping to the previous command does not restore x = 4. x is still 5.

If all you want to do is execute arbitrary commands, I'd just copy and paste the command into the debug terminal. If you want to run multiple commands in order I guess it makes sense to jump to cursor and then run to cursor.
Quote:cursor is not moving to backword,
only I am getting pop window of command palate
Yes.and then have to start typing Debug: Jump to Cursor command and choose it.
[Image: RmDnC.gif]
Hi snippsat,

Superrrrrrrrrrrb ! very happy , thanks for for your help, Clap

one more help if you can , In pycharm another ide how to achieve this thing.



Thanks
mg
Pages: 1 2