Code Monkey home page Code Monkey logo

c.tmbundle's Introduction

TextMate

Download

You can download TextMate from here.

Feedback

You can use the TextMate mailing list or #textmate IRC channel on freenode.net for questions, comments, and bug reports.

You can also contact MacroMates.

Before you submit a bug report please read the writing bug reports instructions.

Screenshot

textmate

Building

Setup

To build TextMate, you need the following:

All this can be installed using either Homebrew or MacPorts:

# Homebrew
brew install boost capnp google-sparsehash multimarkdown ninja ragel

# MacPorts
sudo port install boost capnproto multimarkdown ninja ragel sparsehash

After installing dependencies, make sure you have a full checkout (including submodules) and then run ./configure followed by ninja, for example:

git clone --recursive https://github.com/textmate/textmate.git
cd textmate
./configure && ninja TextMate/run

The ./configure script simply checks that all dependencies can be found, and then calls bin/rave to bootstrap a build.ninja file with default config set to release and default target set to TextMate.

Building from within TextMate

You should install the Ninja bundle which can be installed via PreferencesBundles.

After this you can press ⌘B to build from within TextMate. In case you haven't already you also need to set up the PATH variable either in PreferencesVariables or ~/.tm_properties so it can find ninja and related tools; an example could be $PATH:/usr/local/bin.

The default target (set in .tm_properties) is TextMate/run. This will relaunch TextMate but when called from within TextMate, a dialog will appear before the current instance is killed. As there is full session restore, it is safe to relaunch even with unsaved changes.

If the current file is a test file then the target to build is changed to build the library to which the test belongs (this is done by setting TM_NINJA_TARGET in the .tm_properties file found in the root of the source tree).

Similarly, if the current file belongs to an application target (other than TextMate.app) then TM_NINJA_TARGET is set to build and run this application.

Build Targets

For the TextMate.app application there are two symbolic build targets:

ninja TextMate      # Build and sign TextMate
ninja TextMate/run  # Build, sign, and (re)launch TextMate

To clean everything run:

ninja -t clean

Or simply delete ~/build/TextMate.

Legal

The source for TextMate is released under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

TextMate is a trademark of Allan Odgaard.

c.tmbundle's People

Contributors

alexreg avatar andyherbert avatar ciaran avatar dhowden avatar galexite avatar infininight avatar jamesqo avatar joachimm avatar jtbandes avatar lilyball avatar nanoant avatar pchaigno avatar quarnster avatar rdwampler avatar reitermarkus avatar sorbits avatar squidfunk avatar vmg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

c.tmbundle's Issues

[C] wrong hiliting of mulline string

1st str not hilited correctly:

#error "dddd \
    edddd \
    "
#warning This is a short warning
/* <- keyword.control.import */
#endif
 /* <- keyword.control.import */

bitwise NOT operator did not get recognized properly when used with function and judging statement

Given the following code:

int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(~fscanf(user_output, "%d", &a)) {
        // ...
    }
}

The ~fscanf part inconsistently displayed itself as purple, while when using other operators it displays black for operator and then blues for the function name:

int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(fscanf(user_output, "%d", &a)) {
        // ...
    }
}
int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(+fscanf(user_output, "%d", &a)) {
        // ...
    }
}
int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(-fscanf(user_output, "%d", &a)) {
        // ...
    }
}

Even for bitwise XOR operator ^ the behavior stays the same:

int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(^fscanf(user_output, "%d", &a)) {
        // ...
    }
}

I believe this caused inconsistency and should be fixed in the future.

[C++] using a operator() of a templated class leads to wrong syntax highlighting results

From @gnaggnoyil on February 23, 2016 12:3

This piece of code:

template <typename T>
struct bar{
    int operator()(char x){
        return 0;
    }
};

struct foo:public bar<int>{
    using bar<int>::operator();
};

seems to produce wrong syntax highlighting results for ollowing class/struct declarations/definations and endif macros. On my workspace(VSCode 0.10.8 with Dark+ (default dark) color scheme) it behaves like this:

wrong syntax highlighting

Other macros including define, include, if and ifdef are not affected though.

Copied from original issue: microsoft/vscode#3315

C++ multiple inheritance syntax coloring

I've noticed that multiple inheritance in class definitions confuses syntax coloring. Consider:

class ClassA: public BaseClass
{
public:
void memberFunction();

private:
int memberVariable;
};

versus

class ClassB: public BaseOne, public BaseTwo
{
public:
void memberFunction();

private:
int memberVariable;
};

In the second case, "member1" is colored like a variable.

[C] Highlight stddef.h and stdint.h types

As it stands now, types and values from stdbool.h (bool, _Bool, true, and false) are highlit, but not those from stddef.h (except NULL) and stdint.h. As those are very commonly used (often almost entirely replacing normal integer types), not having them highlit commonly results in slightly harder-to-read code. The keywords in question are:

  • stddef.h
    • size_t, wchar_t, ptrdiff_t
    • perhaps offsetof
  • stdint.h
    • int8_t, int16_t, int32_t, uint8_t, uint16_t, and uint32_t
    • int_least8_t, int_least16_t, int_least32_t, int_least64_t, uint_least8_t, uint_least16_t, uint_least32_t, and uint_least64_t
    • int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t, uint_fast8_t, uint_fast16_t, uint_fast32_t, and uint_fast64_t
    • intptr_t and uintptr_t
    • intmax_t and uintmax_t

Keywords not highlighted after macros with parentheses

Consider the following C++ snippets, respectively from an Unreal Engine C++ repo and a Flax Engine C++ repo (another C++ 3D engine):

// Harrison McGuire
// UE4 Version 4.20.2
// https://github.com/Harrison1/unrealcpp
// https://severallevels.io
// https://harrisonmcguire.com

#pragma once

#include "Camera/CameraShake.h"
#include "MyCameraShake.generated.h"

UCLASS()
class UNREALCPP_API UMyCameraShake: public UCameraShake {
	GENERATED_BODY()
	
	public:
		// Sets default values for this actor's properties
		UMyCameraShake();
	
};
// Copyright © 2022 PrecisionRender. All rights reserved.

#pragma once

#include "Engine/Scripting/Script.h"
#include "Engine/Core/Common.h"

class CharacterController;

API_CLASS() class GAME_API CharacterControllerPro: public Script {
    API_AUTO_SERIALIZATION();
    DECLARE_SCRIPTING_TYPE(CharacterControllerPro);


    public:
        API_ENUM()
        enum class MovementModes {
            Stopped,
            Walking,
            Running,
            Crouching
        };
// ...

From: https://github.com/Harrison1/unrealcpp/blob/master/CameraShake/MyCameraShake.h and https://github.com/PrecisionRender/CharacterControllerPro/blob/main/CharacterControllerProCPP/CharacterControllerPro.h.

As you can see, the keywords class and public are not highlighted, likely because they follow the macros UCLASS() and API_CLASS(), respectively (newlines make no difference). Oddly, the keywords that follow API_ENUM() seem to be highlighted just fine.

[C++] Syntax highligting issue: initialisation lists

struct test {

    test(int x, int d, std::string dave) :
        _x(x),
        _d(d),
        _dave(dave)
    {

    }

    int _x;
    int _d;
    std::string _dave;
};

struct test2 {

    test2(int x, int d, std::string dave) :
        _x(x)
    ,   _d(d)
    ,   _dave(dave)
    {

    }

    int _x;
    int _d;
    std::string _dave;
};

I believe that github uses this repository for its syntax highlighter. Looking above, both pieces of code are the same but show different highlighting. test2 is the broken highlighted version

Incorrect highlighting of multiline preprocessor macro

Example:

# define SIMDTBX_INTEL_GCC_VERSION \

(**GNUC**_10000 +**GNUC_MINOR**_100 + **GNUC_PATCHLEVEL**)

The line starting with "#define" (1st line) is highlighted but not the continuation line (2nd line). That's with Textmate version 2.0 (9090).

Functions in #define never end

This simple line doesn't work properly:

#define foo bar()

The scope of what follows on the next line is still meta.preprocessor.macro.c and meta.function.c.

C++11 support

Any update of this bundle to support new keywords such as nullptr constexpr?

Comments after #endif

After #endif, comments are not recognized as such:

#if FOO
#endif /* FOO */
#if BAR
#endif // BAR

struct member highlighted in red

See here.

The member significand is highlighted in red, while all other members are white. I have searched for matching keywords that might color it this way, but to no avail.

goto targets do not get unindented

Targets for goto should get unindented to the same indentation level as the current function's braces, but they are ignored.

Further, when manually unindenting goto targets, the lines that follow insist on matching the new indentation level.

goto indentation

Preprocessor computed include syntax busts additional highlighting

There's a little known feature of GCC (and clang) called Computed Includes which is basically a way to use a #define or -D or macro value as the #include argument rather than directly using a fixed string. The manual doesn't show the best examples, but the way this tends to be used is without a closing > or basically: #include <MALLOC_H. It's quirky, but legit. Unfortunately the highlighter expects that closing > (and probably closing ") so the result is an overrun like this.

[c++] wrong syntax highlighting results when using decltype and '::'-specfied names in templates

From @gnaggnoyil on February 23, 2016 11:46

I am using currently the latest VSCode version(0.10.8) with 'Dark+ (default dark)' color scheme and the piece of C++ code in the picture below produces wrong syntax highlighting results for following class/struct declarations/definations and endif macros(define, include, if and ifdef macros are not affected though).

wrong syntax highlighting result

Changing foo::bar to somthing that does not use '::' will make all the wrong syntax highlighting results normal again.

Copied from original issue: microsoft/vscode#3309

C++ highlighting fails to highlight certain comma/modulo-heavy code

Sorry for the cruddy title, I don't really know the root cause so I made a best effort guess. Feel free to edit it.

The following valid C++ code completely breaks highlighting, namely for the strings:

auto cli = (
	option("--help").set(show_help)
		% "Show this help message",
	(option("-J", "--threads") & value("num_threads", num_threads))
		% "The number of threads to use (default 0, meaning 'auto')",
	value("db_dir").set(dbdir).required(true).blocking(true)
		% "The database directory location",
	any_other(invalid_params)
);

C++ class definition base cases are not highlighted

The classes and keywords following the ":" in a class definition never seem to be highlighted. In this example, the "public" should be a keyword and the "BaseClass" should be a type.

class Foo: public BaseClass
{
};

C++ final and override keywords are not correctly identified

From @rielz on December 27, 2015 16:58

The C++11 specifiers final and override are missing in the C++ syntax file.
They are context specific keywords, so they must not always be classified as a keyword.

Ironically they are present in the C syntax file with some checks for the correct context.
This check fails for some cases though. These three are currently missing in Code:

class deriv final : base {
    void meth1() final;
    void meth2() override;
}
  • final and override in class declarations
  • final classes ... GitHub seems to be missing that one too 😄

Copied from original issue: microsoft/vscode#1669

Some function names highlight in red with latest update

Hi there,

Since the bundle update of May 5, it appears that the names of some functions calls are being highlighted in red. See picture:

Screen Shot 2020-05-13 at 10 02 29 PM

If I replace the bundle with the previous version from the commit from last year (39898a8), the red highlight disappears.

Perhaps the gl functions are not in the 10.15 SDK?

Macro used as part of C multi-line string literal breaks parsing

There are a few bugs in the parsing of this bit of C code:

1. The first use of the `SAMPLE` macro on line 66 gets tagged as `meta.function.c`, i.e., a function declaration, rather than a function (well, macro) call. 2. This then causes everything up to the first semicolon on line 74 to be included in the `meta.function.c` scope. 3. That in turn means that the closing quote near the end of line 74 is interpreted as an opening quote, which means that all the code after that is considered to be inside a `string.quoted.double.c`.

You can also see this bug on github.com, which uses this bundle for highlighting C code, here: https://github.com/GNOME/clutter/blob/ddda4aec18359aa6bcdff218133c079d4733f155/clutter/clutter-blur-effect.c#L74. This bug was reported to us by one of our users.

Requesting update to C/C++ indentation rules for more common switch statement formatting

TextMate auto-indents C and C++ in an unexpected way. To be specific, I would like to get:

This (1):

switch (x) {
    case 3:
        sdrhit;
    case 4:
        dfsdkfsd;
}

Or this (2):

switch (x) {
case 3:
    sdrhit;
case 4:
    dfsdkfsd;
}

Unfortunately, instead, I get this:

switch (x) {
    case 3:
    sdrhit;
    case 4:
    dfsdkfsd;
}

I figured out how to do this, and here are the necessary edits to the C indent rules:

{   increaseIndentPattern = '(?x)
        ^ .* \{ [^}"'']* $
    |   ^ \s* (public|private|protected): \s* $
    |   ^ \s* @(public|private|protected) \s* $
    |   ^ \s* \{ \} $
    |   ^ \s* (case\b .+ |default):     # NEW!
    ';
    decreaseIndentPattern = '(?x)
        ^ \s* ( (?! \S.* /[*] ) .* [*]/ \s* )? \}
    |   ^ \s* (public|private|protected): \s* $
    |   ^ \s* @(public|private|protected) \s* $
    |   (case\b .+ |default): \s* (/[/*] .*)? $     # NEW!
    ';
    indentNextLinePattern = '(?x)^
        (?! .* [;:{},] \s*                  # do not indent when line ends with ;, :, {, }, or comma
            ( // .* | /[*] .* [*]/ \s* )? $ #  …account for potential trailing comment
        |   @(public|private|protected)     # do not indent after obj-c data access keywords
        )
        .                                  # the negative look-ahead above means we don’t care about what we match here
    ';
    unIndentedLinePattern = '^\s*((/\*|\*/|//|template\b.*?>(?!\(.*\))|@protocol|@optional|@interface(?!.*\{)|@implementation|@end).*)?$';
    zeroIndentPattern = '^\s*#';
}

Even if the devs don't want to make this the default, anyone else encountering this problem could refer to this bug report if they want to change it themselves.

#ifdef breaks "Go to symbol" menu

Hi!
If you invoke the "Go to symbol" menu (cmd + shift+ t) in the following C standalone code, you'll see that all the parsing stops after the first #endif. That is, the function any_function() is not listed in the "Go to symbol" menu.

#include "stdio.h"

#define PREPROCESSOR_FLAG

int main (int argc, char const *argv[])
{

  short regular_flag = 1;

  #ifdef PREPROCESSOR_FLAG
  if (regular_flag) {
  #endif
    printf ("Hello world!\n");
  #ifdef PREPROCESSOR_FLAG
  }
  #endif  

  return 0;
}

int any_function () {
  return 0;
}

The issue goes away if I comment out the line inside the first #ifdef block, that is if (regular_flag) {. By doing so however the code does not compile anymore.

I run Textmate 2.0-beta.7.1 on a Retina MacBook Pro with Mac Os X 10.10.2 (Yosemite).

Thank you for your attention!
Cheers,
Guido

C++ class name not highlighted

From @obhi-d on September 2, 2018 10:8

  • VSCode Version: 1.26.1
  • OS Version: Ubuntu 18.04

Hello everyone,
I notice that class name with attributes preceding it are not highlighted when declared.
As you can see in this image, the EXPORT keyword is presumed to be the class name by syntax highlighter.
screenshot from 2018-09-02 11-55-00

Does this issue occur when all extensions are disabled?: Yes

Copied from original issue: microsoft/vscode#57771

HIP support for sublime text

Hi,
Before I start, HIP is an interface for running GPU code on both AMD and NVIDIA GPUs developed by AMD. Here is a sample file I am trying to add HIP support for sublime through this repository because it uses .cpp extension. Will that be ok?

C++ syntax highlighting is not correct

From @milesxu on March 12, 2016 7:20

When I use vscode to browse the db_bench.cc in the source code of rocksdb, I found the syntax highlighting of C++ is incorrect. Illustrated below:
screenshot of syntax highlighting in vscode,
vscode-cpp
whereas, the same content displayed in atom
atom-cpp

The colors used in atom editor is much richer, and it will not misinterpret keywords in strings such as if or for.
Environment:
ArchLinux 4.4.5 64bit
vscode 0.10.10
atom 1.5.3

Copied from original issue: microsoft/vscode#4061

[C] Preprocessor directive and string or multiline

I found an error in the code highlighting.

#ifdef __cplusplus
extern "C" {
#endif

The endif is not properly set to red color.

#if ((XTIMER_HZ % 15625) == 0)
#error "Unsupported hardware timer frequency (XTIMER_HZ), missing XTIMER_SHIFT \
in board.h? See xtimer.h documentation for more info"
#else
#error "Unknown hardware timer frequency (XTIMER_HZ), check board.h and/or add \
an implementation in sys/include/xtimer/tick_conversion.h"
#endif
#endif

And also in this code the two directives are not correctly set to red.

single-line comments break highlighting on the next line

On GitHub.com, C++ code is incorrectly highlighted after a line that contains a // comment.

Example code demonstrating the problem:

const byte hello = 1;  // This is a comment
const byte world = 2;  // `const` should be highlighted, but it is not

const byte foo = 3; /* This problem does not occur with multiline comments. */
/* Multiple
lines */
const byte bar = 4;

// This comment breaks highlighting as well.
const byte a = 5;
const byte b = 6;

// This also breaks highlighting in other ways
int main() {}

int test() {}

// Even this breaks
x_y();

y_z();

// Another example
a_z(); a_z();

Reporting here because of instructions in this repo.

#include<foo> is not highlighted

image

Or directly here:

#include<iostream>

vs

#include <iostream>

However when editing the file, the highlighting is correct (probably because of ACE mode):

image

Moved from here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.