Giter Club home page Giter Club logo

bundle-support.tmbundle's People

Contributors

andreamazz avatar bnmnetp avatar bradchoate avatar ciaran avatar down10 avatar filiptepper avatar fredb avatar infininight avatar jacob-carlborg avatar jeg2 avatar ldaley avatar lilyball avatar nanoant avatar noniq avatar rdwampler avatar sanssecours avatar simongregory avatar sorbits avatar soryu avatar subtlegradient avatar torsten avatar windwiny avatar yuuq avatar

Stargazers

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

Watchers

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

bundle-support.tmbundle's Issues

plist.bundle is missing architecture arm64e (M1 error with bundles)

The bundled Support/shared/lib/osx/plist.bundle is missing architecture arm64e – can we do anything about it?

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(~/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/osx/plist.bundle, 0x0009): tried: '~/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/osx/plist.bundle' (fat file, but missing compatible architecture (have 'unknown,i386,x86_64', need 'arm64e')), '/usr/lib/plist.bundle' (no such file) - ~/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/osx/plist.bundle (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from ~/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/textmate.rb:5:in `<top (required)>'
⋮
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from Validate Bash:2:in `<main>'

html_header from webpreview.sh throw warning and incorrect escaped string if TM_THEME_PATH contain non-ASCII character

Steps to reproduce:

  1. Open Bundle Editor (⌃⌥⌘B)

  2. Create a new bundle (⌘N) and also this bundle default name contain apostrophe such as non-ASCII character

  3. Create new settings (⌘N) and then paste below settings for export TM_THEME_PATH

    {   shellVariables = (
            {   name = 'TM_THEME_PATH';
                value = '${TM_THEME_PATH:+$TM_THEME_PATH:}$TM_BUNDLE_SUPPORT/web-themes';
            },
        );
    }
    
  4. Move to Finder and create a new Support/web-themes/foo/ folders to above bundle

  5. Back to TextMate and create style.css and save to above foo folder

  6. Create new untitled empty document (⌘N)

  7. Change language grammer to Shell Script (Bash) (⌃⌥⇧S)

  8. Paste below script and then run script (⌘R)

    #!/usr/bin/env bash
    [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
    
    . "$TM_SUPPORT_PATH/lib/webpreview.sh"
    html_header "foo"
    
  9. Ran results contain below warning and incorrect escaped string

    escape.rb:23: warning: regexp match /.../n against to UTF-8 string
    file:///Users/anri/Library/Application%20Support/Avian/Bundles/Anri%E2s%20Bundle.tmbundle/Support/web-themes/foo/style.css

    Anri%E2s%20Bundle.tmbundle apostrophe escape should be Anri%E2%80%99s%20Bundle.tmbundle

Sorry for verbose reproduce step.

Expected result:
Properly URL escaped TM_THEME_PATH
file:///Users/anri/Library/Application%20Support/Avian/Bundles/Anri%E2%80%99s%20Bundle.tmbundle/Support/web-themes/foo/style.css

Actual result:
Incorrect URL escaped TM_THEME_PATH
file:///Users/anri/Library/Application%20Support/Avian/Bundles/Anri%E2s%20Bundle.tmbundle/Support/web-themes/foo/style.css

Environment:
OS X version: 10.9.4
TextMate version: 2.0-alpha.9561
Language grammer: Shell Script (Bash)

Exception when selected theme is missing

The theme_path variable in Support/lib/tm/htmloutput.rb is only setup/initialized when we find the user’s selected theme.

A scenario may arise where user install a (web preview) theme, selects it, and then deletes it.

This leads the theme_path variable to be nil causing an exception in the ERb code that does: <%= e_url theme_path %>.

Markdown preview broken (possibly others)

Introduced in commit 81359c0

Not when previewing anything, I get a stacktrace for:

/Users/miketheman/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require':
/Users/miketheman/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/tm/htmloutput.rb:87: invalid multibyte char (US-ASCII) (SyntaxError)
/Users/miketheman/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/tm/htmloutput.rb:87: invalid multibyte char (US-ASCII)
/Users/miketheman/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/tm/htmloutput.rb:87: syntax error, unexpected $end, expecting keyword_end ...le is enabled in Preferences → Bundles." if active_theme.n... ... ^ from
/Users/miketheman/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' from
/Users/miketheman/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/web_preview.rb:1:in `' from
/Users/miketheman/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' from
/Users/miketheman/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'

Due to the arrow character not being in the ASCII set.

Looks like adding # encoding: utf-8 to the top of the file might solve this.

images in TextMate::UI.complete

Hi, I can't get images to work with a ruby-command. This is my code:

#!/usr/bin/env ruby18 -wKU
require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'

choices = [
  {"display"=> "test1", "image"=>"func"},
]
TextMate::UI.complete(choices, :images => {
  "func" => "/Applications/test.png"
});

Provide 64-Bit Version of `find_app`

Problem Description

Since Apple will discontinue support for 32-Bit applications sometimes in the future, we should add support for the x86_64 ISA to find_app.

Steps to Reproduce the Problem

cd Support/shared/bin
file find_app

Expected Result

The output of the last command should list x86_64 as supported architecture.

Actual Result

The command file find_app prints the following output:

find_app: Mach-O universal binary with 2 architectures: [ppc:Mach-O executable ppc] [i386:Mach-O executable i386]
find_app (for architecture ppc):	Mach-O executable ppc
find_app (for architecture i386):	Mach-O executable i386

.

Provide API for running Ruby executables like rspec, rubocop etc.

Running Ruby executables like rspec or rubocop turns out to be rather complicated nowadays: You need to support binstubs, Gemfiles and bundle exec, RVM and rbenv, …

Right now, each bundle needing to this is reinventing the wheel, see for example:

All implementations are different (and quite likely buggy in one way or another – at least the ones I wrote 😄 ).

I think it would make sense for TextMate to provide an API for doing exactly this.

Include 64-Bit Version of CocoaDialog in Bundle

Steps to Reproduce the Issue

  1. Install Skim and the LaTeX bundle (in “Preferences…” → “Bundles”)

  2. Create a new document with the following content:

    \documentclass{article}
    
    \begin{document}
      Test
    \end{document}
  3. Save the file using the name Test.tex

  4. Invoke the command “Watch Document” (^ + + W)

Expected Result

TextMate compiles the document, and opens the resulting PDF in Skim.

Actual Result

TextMate shows the following window:

cocoadialog

informing us, that the included version of CocoaDialog should be updated. After we click on the “OK” button everything works fine.

Additional Information

I built the current version of CocoaDialog and replaced (CocoaDialog.app) with the newly-built application. Afterwards I changed the name of cocoadialog.app and cocadialog to CamelCase (CocoaDialog). Unfortunately that did not work. It seems like CocoaDialog is crashing with exit value 51.

System Information

  • TextMate 2.0-rc.22
  • macOS 10.14.2

Encoding of Python files

I'm using the Python bundle (https://github.com/textmate/python.tmbundle) with TextMate 2.0-alpha.9551, and when executing Python source files that contain non-ASCII characters, I get the following error:

Failure running “Run Script”.

/Users/freek/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/tm/executor.rb:192:in parse_hashbang': invalid byte sequence in US-ASCII (ArgumentError) from /Users/freek/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/tm/executor.rb:90:inrun'
from Run Script:13:in `

'

This problem can easily be solved in Support/shared/lib/tm/executor.rb line 192:

  def parse_hashbang(file)
    $1.chomp.split if /\A#!(.*)$/ =~ File.read(file)
  end

by changing it to:

  def parse_hashbang(file)
    $1.chomp.split if /\A#!(.*)$/ =~ File.read(file).force_encoding('iso-8859-1')
  end

I picked ISO-8859-1 decoding since it allows any binary input, and is a superset of ASCII. Since we are only interested in the first line of the file, it is irrelevant if the rest of the file is incorrectly decoded.

Note that File.read() is called in three different places in this repository. There may be similar problems there:

Support/shared/lib/codecompletion.rb:297: self.raw = File.read(path)
Support/shared/lib/tm/executor.rb:192: $1.chomp.split if /\A#!(.*)$/ =~ File.read(file)
Support/shared/lib/tm/save_current_document.rb:31: # current document after you've called this method, do File.read(ENV['TM_FILEPATH']).
Support/shared/lib/tm/save_current_document.rb:55: return if File.exists?(dst) and File.read(dst) == doc

Ruby 1.8 crashing running commands

I'm getting a crash of ruby1.8 when trying to invoke "Toggle Comment" command from the Source bundle. (Raising it here as it appears to be unrelated to the command run.)

This is with TextMate 2.0-alpha.9551 on OS X 10.10 (14A283o).

The output I see in Console.app is this:

13/07/2014 09:24:50.129 com.apple.xpc.launchd[1]: (com.apple.ReportCrash[65683]) Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.ReportCrash
13/07/2014 09:24:50.131 ReportCrash[65683]: Attempt to read info_array in pid 65682 failed, address was 7fff69b73490
13/07/2014 09:24:50.132 ReportCrash[65683]: Attempt to read info_array in pid 65682 failed, address was 7fff69b73490
13/07/2014 09:24:50.132 ReportCrash[65683]: Attempt to read info_array in pid 65682 failed, address was 7fff69b73490
13/07/2014 09:24:50.133 ReportCrash[65683]: Attempt to read info_array in pid 65682 failed, address was 7fff69b73490
13/07/2014 09:24:50.133 ReportCrash[65683]: Attempt to read info_array in pid 65682 failed, address was 7fff69b73490
13/07/2014 09:24:50.134 ReportCrash[65683]: Attempt to read info_array in pid 65682 failed, address was 7fff69b73490
13/07/2014 09:24:50.209 ReportCrash[65683]: Saved crash report for ruby[65682] version ??? to /Users/caius/Library/Logs/DiagnosticReports/ruby_2014-07-13-092450_YOLO.crash

And then the contents of /Users/caius/Library/Logs/DiagnosticReports/ruby_2014-07-13-092450_YOLO.crash is:

Process:               ruby [65682]
Path:                  /Users/USER/Library/Application Support/TextMate/*/ruby
Identifier:            ruby
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        TextMate [58651]
Responsible:           TextMate [58651]
User ID:               501

Date/Time:             2014-07-13 09:24:50.129 +0100
OS Version:            Mac OS X 10.10 (14A283o)
Report Version:        11
Anonymous UUID:        F20B0B87-7235-D119-8E99-4E31C9A16549

Sleep/Wake UUID:       56EE474A-F47E-4836-A2B3-9FE4F72CBC26

Time Awake Since Boot: 38000 seconds
Time Since Wake:       5500 seconds

Crashed Thread:        0

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000002, 0x0000000000000000

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib
  Referenced from: /Users/USER/Library/Application Support/TextMate/*/ruby
  Reason: image not found

Binary Images:
    0x7fff69b35000 -     0x7fff69b6b67f  dyld (352.2) <D8593292-21DF-3B34-97D1-C9CBEA96E193> /usr/lib/dyld

I can see from the code in d31c137 that the install logs to a file, but that file is empty and ~/Library/Application\ Support/TextMate/Ruby/1.8/bin/ruby exists.

Running the ruby binary directly also results in the dylib error though:

YOLO:~ caius$ ~/Library/Application\ Support/TextMate/Ruby/1.8/bin/ruby --version
dyld: Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib
  Referenced from: /Users/caius/Library/Application Support/TextMate/Ruby/1.8/bin/ruby
  Reason: image not found
[1]    65738 trace trap  ~/Library/Application\ Support/TextMate/Ruby/1.8/bin/ruby --version

Universal substitute for CocoaDialog which is Intel only

CocoaDialog has apparently been abandoned as the last commit is from 2017.

TextMate includes it in the BundleSupport folder and that means that at some point Rosetta 2 will be required to run it in Apple Silicon Macs.

It would be interesting to find an alternative that is well maintained and supports an Universal binary.

TextMate::Executor.run show broken preview

when update beta12.4 -> 12.8

TextMate::Executor.run show different and broken preview in each run.

package main

import "fmt"

func main() {
  fmt.Println("Hello")
}

run this snippet three times, it returned like below.

screen shot 2016-09-05 9 57 37
screen shot 2016-09-05 9 57 43
screen shot 2016-09-05 9 57 47

so I remove all Avian/Bundles and try this again, but nothing was solved.

Create new snippets, etc.

How does one create new snippets, macros and commands in TM2? The Edit Bundles window has no small + as it does in TM1. (I posted the same question under Latex.tmbundle by mistake.)

Remove TextMate.selected_paths_array from shelltokenize.rb, but maybe keep functionality?

This is more or less a duplicate of TextMate.selected_files from textmate.rb. It is currently only used in a few places in the CVS, Mercurial, SVK and SVN bundles (sometimes via TextMate.selected_paths_for_shell).

However, there is one difference: If no files are selected, selected_path_array returns an array with a single entry for ENV["TM_FILEPATH"], or an empty array if this is not set. selected_files returns nil in those cases.

I wonder whether this functionality (“Give me an array of selected files, falling back to the current file if nothing is selected“) is so common that it should be part of the “official” bundle support API?

For example, the Git bundle has its own rather elaborate implementation that even supports different fallbacks (current file vs. project directory) and optional unique-filtering: https://github.com/textmate/git.tmbundle/blob/d1db42c2d71948662098183a6df519fb53a7a15b/Support/lib/git.rb#L114-L137

What do you think?

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.