Skip to content

Place before namespace if no include found#5

Open
m42e wants to merge 1 commit into
quark-zju:masterfrom
m42e:include_placement
Open

Place before namespace if no include found#5
m42e wants to merge 1 commit into
quark-zju:masterfrom
m42e:include_placement

Conversation

@m42e

@m42e m42e commented Dec 17, 2015

Copy link
Copy Markdown

In case you use this in header files, it would be better to look for a
namespace declaration then putting it on top, where the guard header
should be.

Comment thread plugin/cpp_auto_include.vim Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Just change the line number of the place holder:

includes[0][-1] = i

This will save some bytes especially when there are multiple namespaces

@quark-zju

Copy link
Copy Markdown
Owner

Nice catch 😃 Thanks!

In case you use this in header files, it would be better to look for a
namespace declaration then putting it on top, where the guard header
should be.
@m42e
m42e force-pushed the include_placement branch from 8600479 to e0aae75 Compare December 18, 2015 06:47
@m42e

m42e commented Dec 21, 2015

Copy link
Copy Markdown
Author

Done, even if I didn't really get what is happening there ... :D I'm not to familiar with ruby

@m42e

m42e commented Apr 19, 2016

Copy link
Copy Markdown
Author

would you mind merging the pull requests?

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