textmate / bundle-support.tmbundle Goto Github PK
View Code? Open in Web Editor NEWThe shared support folder
The shared support folder
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>'
Steps to reproduce:
Open Bundle Editor (⌃⌥⌘B)
Create a new bundle (⌘N) and also this bundle default name contain apostrophe such as non-ASCII character
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';
},
);
}
Move to Finder and create a new Support/web-themes/foo/ folders to above bundle
Back to TextMate and create style.css and save to above foo folder
Create new untitled empty document (⌘N)
Change language grammer to Shell Script (Bash) (⌃⌥⇧S)
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"
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)
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 %>
.
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.
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"
});
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
.
cd Support/shared/bin
file find_app
The output of the last command should list x86_64
as supported architecture.
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
.
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.
Install Skim and the LaTeX bundle (in “Preferences…” → “Bundles”)
Create a new document with the following content:
\documentclass{article}
\begin{document}
Test
\end{document}
Save the file using the name Test.tex
Invoke the command “Watch Document” (^ + ⌘ + W)
TextMate compiles the document, and opens the resulting PDF in Skim.
TextMate shows the following window:
informing us, that the included version of CocoaDialog should be updated. After we click on the “OK” button everything works fine.
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
.
2.0-rc.22
10.14.2
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:in
run'
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
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
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.
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.)
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?
Hi!
I opened the ticket for the golang.tmbundle.
But looks is the bundle-support issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.