Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hook to highlight current line in external editor (sticky) #16

Open
antocuni opened this issue Apr 12, 2012 · 3 comments
Open

hook to highlight current line in external editor (sticky) #16

antocuni opened this issue Apr 12, 2012 · 3 comments

Comments

@antocuni
Copy link
Collaborator

Originally reported by: Anonymous


Hi,
I would like to add a command to highlight the current line of the debugged file in an external editor. I guess this could be easily achieved by calling 'edit +linenumber filename'.
Can I do this by editing .pdbrc.py, then defining a Pdb.do_highlight method in the setup method of the Config class? If so, where are the current line and filename stored?
Finally, could this be made "sticky"? I.e., at each step, highlight the current line? Could this also be achieved via the rc file?

Thanks
Christian


@antocuni
Copy link
Collaborator Author

Original comment by Anonymous:


Ops, sorry, just noticed that the edit command does exactly what I need, so the only missing part would be a "sticky" mode for the external editor.

Thanks

@antocuni
Copy link
Collaborator Author

Original comment by Antonio Cuni (Bitbucket: antocuni, GitHub: antocuni):


Yes, I was about to tell you to look at the command "edit" :-)

As for executing it at at each step, there is no straightforward way to do it, I fear. I suppose I could add a hook in the config file which gets called at each step: would that work for you?

@antocuni
Copy link
Collaborator Author

Original comment by Anonymous:


Yes, that would be nice, it could allow a user to make custom versions of what is shown by the display command as well?
BTW, I noticed that _printlonglist has a linerange parameter, but this is not used by the longlist command. Is there any reason for that? I see that on the issue list there is a request for custom length longlist display, so wouldn't it be sufficient to use that parameter? same for sticky mode...

Finally (then I'm done with demands!), while I appreciate that debugger commands are always overridden by local variables, there are situations where the opposite is useful. How about a config option to choose if n steps to next line or shows the local variable n? This is especially annoying since pressing enter on an empty line does not repeat !!n, but acts as if I input just n. So typing !!n steps to the next line, while a subsequent enter on empty line shows the value of variable n. Maybe that is a bug?

Thanks!

@blueyed blueyed changed the title highlight current line in external editor? hook to highlight current line in external editor (sticky) Mar 16, 2019
blueyed pushed a commit that referenced this issue May 28, 2019
Make a whole bunch of changes to py3k branch to make all the tests pass and make pdb++ work in Python 3!
blueyed added a commit to blueyed/pdbpp that referenced this issue Apr 30, 2021
(cherry picked from commit 6dd3ab7)

Conflicts:
	testing/test_pdb.py
	tox.ini
blueyed added a commit that referenced this issue May 4, 2021
Move to GitHub Actions, based on recent change on master, pulling in fixes as necessary to make it work here.

NOTES:
 - Tests on Windows are not included, although a fix should not be that hard, mostly related to quoting of filenames (cb56e1b).

* ci: use .coveragerc (#304)

This allows for `pytest --cov` without `--cov-config=tox.ini`, which
would otherwise result in the config not being picked up in some case.
Also makes it clearer that coverage is used.

(cherry picked from commit 461a4ca)

* ci: move to GitHub Actions (#444)

Closes #441.

(cherry picked from commit 3476f0a)

* build(ci): codecov: remove verbose=true (#446)

(cherry picked from commit b326f14)

* Fix hideframe decorator for Python 3.8 (#263)

(cherry picked from commit 90e1a30)

Ref: #263

* ci: checkqa: fix running flake8 for testing (#16)

(cherry picked from commit 6dd3ab7)

Conflicts:
	testing/test_pdb.py
	tox.ini

* fix(qa): flake8 fixes (F522)

* fix(tests): fix test_pdbrc_continue for newer PyPy3

Backport of 1539867, without changes to
.travis.yml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant