Spyder: History plugin: add an option to show/hide line numbers

Created on 17 Feb 2015  路  10Comments  路  Source: spyder-ide/spyder

_From [email protected] on 2012-03-11T00:27:55Z_

Enhancement Request

When using Spyder with IPython it is often helpful to make quick macros of code when working on the command line. To do this efficiently, one must know which lines from the history to place in the macro. As I often work with the history visible it would be helpful if there were an option to display the history line numbers in the pane for easy reference.

Spyder 2.1.17
Windows 7 x64

_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=970_

1 star Easy Help wanted History Log Enhancement

All 10 comments

_From pierre.raybaut on 2012-03-18T08:55:30Z_

Summary: History plugin: add an option to show/hide line numbers
Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-Low

_From pierre.raybaut on 2012-03-18T08:55:39Z_

Labels: Cat-HistoryLog

_From pierre.raybaut on 2012-03-18T14:05:22Z_

Labels: -Type-Enhancement Type-Enh

_From ccordoba12 on 2013-02-13T09:19:28Z_

Labels: MS-v2.3

_From pierre.raybaut on 2013-05-11T05:51:59Z_

Labels: -MS-v2.3 MS-v2.4

Would it be OK for me to work on this issue? I'll try to add tests for history.py at the same time.

Hi @csabella thanks for willing to help! and go ahead! just make sure to take as base of your PR the master branch :)

@csabella Thanks again for contributing to spyder 馃槃

You need to add a PanelManager and a LineNumberArea panel to it, you could take a look to the CodeEditor code (History shares the same base class with the editor and works somehow similar), If you need help ask us in gitter

I did it a little differently than adding a PanelManager, but it seems to work OK. It already creates an instance of CodeEditor, which has linenumber as a setup argument. Instead of it always being False, it's now controlled by config.

I did it a little differently than adding a PanelManager, but it seems to work OK. It already creates an instance of CodeEditor, which has linenumber as a setup argument. Instead of it always being False, it's now controlled by config.

I was wrong, I thought History inherits of TextEditBaseWidget instead of CodeEditor

Was this page helpful?
0 / 5 - 0 ratings