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

Fix selection end column if pruning an empty last column #6184

Merged
merged 1 commit into from Nov 26, 2023

Conversation

tommy9
Copy link
Member

@tommy9 tommy9 commented Nov 25, 2023

Fixes #6181

When a selection of code includes a trailing blank line, the GetSelection method cuts this line and sets the end column to the length of the previous line. However, selections are supposed to be one-based, so we want the length plus 1. E.g. if selecting a line which is just End, we should see start column = 1, end column = 4 which we do if that is the only line selected but if changing the selection to include an extra blank line, the selection gets modified to have end column = 3.

I'm not sure exactly why the last blank line if being pruned but it's not relevant to this issue. Note that only one blank line would be pruned even if there are multiple.

@rubberduck-vba-releasebot
Copy link
Member

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

Merging #6184 (ce21fbf) into next (9323f70) will increase coverage by 0.24%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #6184      +/-   ##
==========================================
+ Coverage   97.34%   97.58%   +0.24%     
==========================================
  Files           4        4              
  Lines         413      413              
  Branches       28       28              
==========================================
+ Hits          402      403       +1     
  Misses          6        6              
+ Partials        5        4       -1     

see 1 file with indirect coverage changes

Copy link
Member

@retailcoder retailcoder left a comment

Choose a reason for hiding this comment

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

Thank you so much for taking the time to do this!

@retailcoder retailcoder merged commit fee096f into rubberduck-vba:next Nov 26, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants