Coder Social home page Coder Social logo

icedman / nvim-textmate Goto Github PK

View Code? Open in Web Editor NEW
76.0 4.0 7.0 5.52 MB

A textmate-based syntax highlighter for neovim - compatible with VScode

License: GNU General Public License v2.0

CMake 0.17% Lua 0.08% Makefile 0.12% Shell 0.06% Batchfile 0.01% M4 0.01% C 57.04% Python 0.99% Ruby 0.43% Starlark 0.01% HTML 0.03% C++ 7.88% Perl 0.01% Meson 0.04% PHP 0.01% TypeScript 0.03% C# 0.01% JavaScript 33.09% Go 0.01% Less 0.01%

nvim-textmate's Issues

Not loading any colors

When i select the theme with TxMtTheme and try to enable it with TxMtEnable i get no colors at all, it's all white.
When i try to disable it with TxMtDisable i get this error:

Error executing Lua callback: ...ck/packer/start/nvim-textmate/lua/nvim-textmate/init.lua:430: attempt to concatenate field 'colors_name' (a nil value)
stack traceback:
        ...ck/packer/start/nvim-textmate/lua/nvim-textmate/init.lua:430: in function <...ck/packer/start/nvim-textmate/lua/nvim-textmate/init.lua:421>

User commands are not being loaded

Even though the plugin has been loaded, as evidenced by the "Compiling textmate module..." message, the user commands (TxMtEnable, TxMtDisable, etc) are not defined.

I haven't written any plugins myself, but judging by what I've seen in other plugins I think you ought to export a module with the required functions from the lua directory and define the commands from the plugin directory -- I'm not sure what the usual way to refer to this is, but where those instructions are placed affects when and how they are loaded by (neo)vim.

P.S.: The README says that the plugin is loaded with require('textmate'), but that won't work because the module is called nvim-textmate (the name coincides with the directory containing the init file under lua). I attempted loading the plugin with both require('nvim-textmate') and require('nvim-textmate').setup(), but only the latter appeared to have any effect.

Windows support?

I use NeoVim on Windows, but I do have WSL Ubuntu. Make doesn't really work well on Windows, so I ended up using WSL, and changed up some files to make it work somehow

diff --git a/libs/Onigmo/configure.ac b/libs/Onigmo/configure.ac
index f6841b1..a550396 100644
--- a/libs/Onigmo/configure.ac
+++ b/libs/Onigmo/configure.ac
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(onigmo, 6.2.0)
 
-AC_CONFIG_MACRO_DIR([m4])
+# AC_CONFIG_MACRO_DIR([m4])
 
 AM_INIT_AUTOMAKE([foreign subdir-objects])
 AC_CONFIG_HEADER(config.h)
diff --git a/libs/tm-parser/textmate/extensions/extension.cpp b/libs/tm-parser/textmate/extensions/extension.cpp
index b7723d1..e766a43 100644
--- a/libs/tm-parser/textmate/extensions/extension.cpp
+++ b/libs/tm-parser/textmate/extensions/extension.cpp
@@ -132,21 +132,27 @@ void load_extensions(const std::string _path,
     for (const auto& extensionPath : enumerate_dir(path)) {
         std::string package = extensionPath + "/package.json";
         std::string packageNLS = extensionPath + "/package.nls.json";
+        Json::Value p = parse::loadJson(package);
 
         // log("extension: %s\n", package.c_str());
 
         struct extension_t ex = { .id = "",
             .publisher = "",
+            .name = "",
             .path = extensionPath,
+            .base_path = "",
+            .nlsPath = packageNLS,
+            .package=p,
+            .nls=p,
             .hasThemes = false,
             .hasIcons = false,
             .hasGrammars = false,
             .hasCommands = false,
-            .addToHistory = false };
+            .addToHistory = false,
+            .nlsLoaded = false,
+            .grammars={}
+        };
 
-        ex.nlsPath = packageNLS;
-        ex.nlsLoaded = false;
-        ex.package = parse::loadJson(package);
         if (!ex.package.isObject()) {
             continue;
         }
diff --git a/libs/tm-parser/textmate/textmate.cpp b/libs/tm-parser/textmate/textmate.cpp
index 6a9ec73..97a8c56 100644
--- a/libs/tm-parser/textmate/textmate.cpp
+++ b/libs/tm-parser/textmate/textmate.cpp
@@ -160,6 +160,7 @@ std::vector<list_item_t> Textmate::theme_extensions()
             list_item_t item = {
                 .name = ext.package["id"].asString(),
                 .description = ext.package["description"].asString(),
+                .icon="",
                 .value = ext.path + "/" + themes[i]["path"].asString()
             };
 
@@ -212,6 +213,7 @@ std::vector<list_item_t> Textmate::grammar_extensions()
                     list_item_t item = {
                         .name = lang["id"].asString(),
                         .description = ext.package["description"].asString(),
+                        .icon="",
                         .value = ex.asString()
                     };
                     res.push_back(item);

But transferring the ./lua/nvim-textmate to my AppData/Local/nvim/lua doesn't work. As it says Done. Restart NeoVim , and I'm unable to use any of the commands.

CMake unable to find jsoncpp.cpp

Every time i open NeoVim i get the message "Done. Restart NeoVim.". In order to find out why it didn't work i decided to build from ~/.local/share/nvim/lazy/nvim-textmate and got the next error message when running make

...
config.status: executing libtool commands                                                                                                                              
config.status: executing default commands                                                                                                                              
mkdir -p build                                                                                                                                                         
cd build && cmake ../cmake && make                                                                                                                                     
-- Configuring done (0.0s)                                                         
CMake Error at CMakeLists.txt:82 (add_library):           
  Cannot find source file:

    ../libs/jsoncpp/dist/jsoncpp.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .
                                                                                   
CMake Error at CMakeLists.txt:82 (add_library):                                    
  No SOURCES given to target: 

CMake Generate step failed.  Build files cannot be regenerated correctly.          
make: *** [Makefile:10: build] Error 1

Printing the output from vim.fn.system({ "make", "build", "-C", target_path }) in ~/.local/share/nvim/lazy/nvim-textmate/lua/nvim-textmate/init.lua gives the same error message. The error comes from ../cmake/CMakeList.txt in the

add_library( textmate
    SHARED
...

section.

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.