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

Block comment incorporating whitespace excludes last line #2356

Closed
ralexx opened this issue Apr 24, 2015 · 0 comments
Closed

Block comment incorporating whitespace excludes last line #2356

ralexx opened this issue Apr 24, 2015 · 0 comments

Comments

@ralexx
Copy link

ralexx commented Apr 24, 2015

Description

  • What steps will reproduce the problem?
  1. Select lines of code where one or more lines of whitespace are interspersed i.e. neither first nor last
  2. First line selected must be the beginning of a contiguous block of code >= 6 lines long
  3. The number of lines of code selected and the placement of the whitespace appears significant
  • What is the expected output? What do you see instead?

Selecting the following and block commenting

somecode = 1
morecode = 2
stillanother = 3
somecode = 1
morecode = 2
stillanother = 3

somecode = 1
morecode = 2
stillanother = 3

should result in

#==============================================================================
# somecode = 1
# morecode = 2
# stillanother = 3
# somecode = 1
# morecode = 2
# stillanother = 3
# 
# somecode = 1
# morecode = 2
# stillanother = 3
#==============================================================================

but instead results in

#==============================================================================
# somecode = 1
# morecode = 2
# stillanother = 3
# somecode = 1
# morecode = 2
# stillanother = 3
# 
# somecode = 1
# morecode = 2
#==============================================================================
stillanother = 3
  • Please provide any additional information below

Using the same starting code above, selecting lines 4-9 and block commenting gives the expected result and will not reproduce the last line exclusion. Similarly, selecting lines 2-10 gives the expected result. Inserting a line of whitespace between lines 3 and 4 and the block commenting again behaves as expected.

However, with at least six lines of code in the first block of code before the whitespace, I can reproduce the last line exclusion with an arbitrary number of lines following the whitespace.

No difference whether I select whole lines or click and drag character-by-character.

Version and main components

  • Spyder Version: 2.3.4
  • Python Version: 2.7.9
  • Qt Version : 4.8.6, PyQt4 (API v2) 4.11.3 on Darwin
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

2 participants