Skip to content

Conversation

@kmvanbrunt
Copy link
Member

Some simplification of completion routines

@kmvanbrunt kmvanbrunt requested a review from tleonhardt March 3, 2018 06:33
@codecov
Copy link

codecov bot commented Mar 3, 2018

Codecov Report

Merging #296 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #296     +/-   ##
=========================================
+ Coverage   91.38%   91.48%   +0.1%     
=========================================
  Files           1        1             
  Lines        1474     1480      +6     
=========================================
+ Hits         1347     1354      +7     
+ Misses        127      126      -1
Impacted Files Coverage Δ
cmd2.py 91.48% <100%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59a5923...10338e4. Read the comment docs.

Copy link
Member

@tleonhardt tleonhardt left a comment

Choose a reason for hiding this comment

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

Looks good

# If no path and no search text has been entered, then search in the CWD for *
if not text and line[begidx - 1] == ' ' and (begidx >= len(line) or line[begidx] == ' '):

# Readline places begidx after ~ and path separators (/) so we need to extract any directory
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for the improved comments throughout these tab-completion helper functions! The behavior of readline is somewhat obscure, so these comments should help with maintainability of this code.

@tleonhardt tleonhardt merged commit 024c0fd into master Mar 3, 2018
@tleonhardt tleonhardt deleted the completion_tweaks branch March 3, 2018 14:57
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.

2 participants