Skip to content

C++ Guard Expansion Doesn't Work on Windows #546

Closed
@rgarber11

Description

@rgarber11

In the C++ #guard snippet, the repeated section to change the path: ${TM_DIRECTORY/.*[\\\/](.*)/_${1:/upcase}/} does not support Windows paths with C:... syntax.

Instead, they appear as:

#ifndef INCLUDEC:\Users\rg102\CompileCollective\src_SCAN_H_
#define INCLUDEC:\Users\rg102\CompileCollective\src_SCAN_H_



#endif  // INCLUDEC:\Users\rg102\CompileCollective\src_SCAN_H_

Changing the match group to [\\/\\\\] solves this problem while maintaining *nix compatibility.

Now, on Windows you get:

#ifndef INCLUDE_SRC_SCAN_H_
#define INCLUDE_SRC_SCAN_H_



#endif  // INCLUDE_SRC_SCAN_H_

And you get the same thing on Linux.

If needed, I can submit a PR fixing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions