emacs-refactor icon indicating copy to clipboard operation
emacs-refactor copied to clipboard

Include guard refactors

Open nbfalcon opened this issue 4 years ago • 0 comments

  • Add an include guard
  • Remove an include guard
  • Add #pragma once
  • Remove #pragma once
  • Toggle between include guards/#pragma once
  • All of the above exposed in the menu, context sensitive (i.e. no "remove include guards" if there are none)
  • Skips comments at the start and end of the buffer (i.e. copyright boilerplates, "LocalWords: ")
  • A lot of customization options (custom include guard symbol generators, text after #endif, spaces after #, ...)
  • Handles lots of tricky edge cases:
#ifndef Q
#define Q

in\
t main() {}

#endif /* Q */```

->

```c++
#ifndef Q
#define Q

in\
t main() {}

#endif /* Q */

Fixes #62.


nbfalcon avatar Jan 09 '21 19:01 nbfalcon