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

Specify toggle value on cell line number #2903

Merged
merged 2 commits into from Feb 16, 2013

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Feb 9, 2013

this allow to call toggle_line_number by specyfying wether you want to
show or hide the line number with a boolean.
Without parameter it continue to toggle to the opposite of curent state

this.code_mirror.refresh();
return
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, if this sets an explicit value, it's not toggling anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it "toggles" only when called without argument. I have no strong
feeling about a different name if you prefere.
Le 10 févr. 2013 00:42, "Min RK" notifications@github.com a écrit :

In IPython/frontend/html/notebook/static/js/cell.js:

  **/
  • Cell.prototype.toggle_line_numbers = function () {
  • Cell.prototype.toggle_line_numbers = function (value) {
  •    if(value != undefined){
    
  •        this.code_mirror.setOption('lineNumbers', value);
    
  •        this.code_mirror.refresh();
    
  •        return
    
  •    }
    

Just to be clear, if this sets an explicit value, it's not toggling
anymore.


Reply to this email directly or view it on GitHubhttps://github.com//pull/2903/files#r2954147..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a show_line_numbers method for the argument, so that toggling and explicit setting are separate

mostly convenience methods to wrap codemirror one,
plus doc and 1 doc fix (missing curly bracket)
@Carreau
Copy link
Member Author

Carreau commented Feb 10, 2013

Done.

@minrk
Copy link
Member

minrk commented Feb 14, 2013

Should toggle_line_numbers call show_line_numbers? I know it's just a two-line function, so maybe it doesn't make sense.

@Carreau
Copy link
Member Author

Carreau commented Feb 16, 2013

Should toggle_line_numbers call show_line_numbers? I know it's just a two-line function, so maybe it doesn't make sense.

Done.

Carreau added a commit that referenced this pull request Feb 16, 2013
Specify toggle value on cell line number
@Carreau Carreau merged commit 48c19e7 into ipython:master Feb 16, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Specify toggle value on cell line number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants