Skip to content

Fix some gq bugs when tw was set #205

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

Merged
merged 1 commit into from
Aug 14, 2014
Merged

Conversation

JelteF
Copy link
Contributor

@JelteF JelteF commented Jul 16, 2014

Fix some bugs that only occured when tw was set.

@JelteF JelteF closed this Jul 16, 2014
@JelteF JelteF reopened this Jul 16, 2014
@JelteF
Copy link
Contributor Author

JelteF commented Jul 16, 2014

Fixed a bug caused by the fix for the other bugs

@qstrahl
Copy link
Collaborator

qstrahl commented Aug 14, 2014

Looks harmless enough, and I'm itching for a fix, so merging in.

qstrahl pushed a commit that referenced this pull request Aug 14, 2014
Fix some gq bugs when tw was set
@qstrahl qstrahl merged commit 125f931 into pangloss:develop Aug 14, 2014
@JelteF
Copy link
Contributor Author

JelteF commented Aug 14, 2014

The function currently ignores the tw setting and just uses 80 character wrap. Might be easy to implement that. The formatter function doesn't do anything with calls to it from insert mode, so it won't place returns automatically when you go over a line. It would be a bit harder to implement that that works as well.

@qstrahl
Copy link
Collaborator

qstrahl commented Aug 14, 2014

@JelteF You can access the value of 'tw' with the variable &tw

@JelteF
Copy link
Contributor Author

JelteF commented Aug 14, 2014

Thanks, I'll update that sometime later. Since I originally created it for the python pep8 indentation plugin 80 (actually 79) characters was always what you wanted there.

@qstrahl
Copy link
Collaborator

qstrahl commented Aug 14, 2014

I took care of it. Have a peek at 18106a3 if you're interested.

@JelteF
Copy link
Contributor Author

JelteF commented Aug 14, 2014

Interesting, I've never seen anybody use a tw of 72.

@qstrahl
Copy link
Collaborator

qstrahl commented Aug 14, 2014

It's used in git commit messages; assuming (conservatively, nowadays) a terminal 80 characters wide, 72 allows some room for line numbers, fold columns, sign columns, etc. I'm not very attached to the number, just pulled it out of a hat, as it were.

@JelteF
Copy link
Contributor Author

JelteF commented Aug 14, 2014

I think 80 is the more common figure for source code. Quite a lot of editors have a mark at the 80 character limit.

@qstrahl
Copy link
Collaborator

qstrahl commented Aug 14, 2014

That's fair. I'll change it to 80.

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