refactored output.py to correct vim behavior#253
Conversation
- changed vim output from columns to tabs - changed vim command so that jump-to-line commands work
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
My vim command reference, FYI Stack Overflow - Vim : Open multiples files on different lines |
|
Hrm, most people at work I talk to prefer columns rather than tabs (just because its immediately clear that would you be open to putting this behind some kind of system flag? |
- editor "vim" behavior corrected - columns with correct line numbers - editor "vim -p" behavior changed - tabs with correct line numbers
|
I changed it so that "vim" acts as before (columns, but with the correct line number jumps), and setting FPP_EDITOR to "vim -p" opens new tabs. As usual, I'm open to suggestions. |
pcottle
left a comment
There was a problem hiding this comment.
sorry for the delay on this, was offline most of the holidays :) left some comments inline but this looks great, let me pull this down locally and play with it for a bit and then ill probably merge it with some changes
| DEST="./dist/fpp.$VERSION.tar.gz" | ||
| mkdir -p ./dist/ | ||
| tar -cf $DEST src/*.py fpp | ||
| tar -czf $DEST src/*.py fpp |
There was a problem hiding this comment.
this is czf in trunk and was changed recently. you probably reverted this in some kind of rebase or something -- mind dropping the change to this file?
| firstFilePath, firstLineNum = filesAndLineNumbers[0] | ||
| cmd += ' +%d %s' % (firstLineNum, firstFilePath) | ||
| for (filePath, lineNum) in filesAndLineNumbers[1:]: | ||
| cmd += ' +"vsp +%d %s"' % (lineNum, filePath) |
There was a problem hiding this comment.
woahhh so vsp does vertical split like -O and allows you to specify the line numbers? very cool!
| return 'vim', 'vim' | ||
|
|
||
|
|
||
| def getEditFileCommand(filePath, lineNum): |
There was a problem hiding this comment.
ah i see why this had to go -- yeah you didnt have global context when composing these mini-parts.
| cmd += ' +%d %s' % (firstLineNum, firstFilePath) | ||
| for (filePath, lineNum) in filesAndLineNumbers[1:]: | ||
| cmd += ' +"tabnew +%d %s"' % (lineNum, filePath) | ||
| elif editor == 'vim': |
There was a problem hiding this comment.
note to self -- we lost the FPP_DISABLE_SPLIT behavior here so lets add that back
(Feel free to modify as needed.)