In the bundle I've created I'm attempting to refine my scopes. Take
the following example:
INT. SHIPYARD DOCKS - DAY
The above line falls under the scopes "text.splay.screenplay" (the
document) and "splay.slugline" (the element). What I want is to be
able to define the three separate elements: "INT", "SHIPYARD DOCKS",
"DAY" as independent scopes, while retaining their status as
"splay.slugline" So "INT" would fall under the jurisdiction of
"text.splay.screenplay splay.slugline splay.slugline.setting".
I guess the simple question is: how do you stack more than two (the
document and the element) scopes?
In Markdown a link gets text.html.markdown,
markup.paragraph.markdown, markup.underline.link.markdown... how do I
do that?
I recorded a macro to search forwards and backwards for
(?=(?:private|public)( static)? ), which is working nicely for
ActionScript, but it'd be interesting to see it tied into the language
grammers somehow. Any thoughts?
Ben
___________________
Ben Jackson
Diretor de Desenvolvimento
ben(a)incomumdesign.com
http://www.incomumdesign.com
This has been such a fun project. Couldn't keep myself away:
http://blog.inquirylabs.com/2006/02/19/syncpeople-on-rails-07/
== Summary ==
Easily navigate between ActionMailer models, views, partials,
controllers, helpers, javascripts and stylesheets with a single key
(keypad 'enter') in TextMate. This release also adds an Enhanced
TODO List (ctrl-shift-t) and is now officially LGPL licensed.
Duane Johnson
(canadaduane)
http://blog.inquirylabs.com/
Not sure what you need to debug this, but all of a sudden indentation
has stopped working in the php bundle. I've tried trashing the pref
files, my bundles and themes, and even trashing txmate itself, and
nothing is bringing it back.
Any Suggestions?
Eric Coleman
I'm stumped again. I got > comments working for plain text documents
using this method, but now I want to set // type comments for all php
source. I've tried adding the following preferences to both PHP and HTML
bundles, using source.php as the selector:
/* preferences */
{
shellVariables = (
{ name = 'TM_COMMENT_START';
value = '// ';
},
{ name = 'TM_COMMENT_END';
value = '';
},
{ name = 'TM_COMMENT_MODE';
value = 'line';
},
);
}
Doesn't work! I've tried with .php files set to both HTML and PHP
language types.
Idears?
Thanks again, Q
PS: Is it _always_ appropriate to use "HTML" as a file's language? I
noticed the "Source -> View source as HTML" command doesn't work unless
you select " X PHP -> Use HTML".
Hello,
I'm trying Spell Catcher X, and I notice that it does not work so
well with Textmate when using "Auto-Show Suggestions" with a popup
list: the popup list is shown when there is a mistake, but no more
input is processed until I click on the window.
Is this a known bug of Textmate or Spell Catcher X? As both programs
look really nice, I'd be glad to have both work together.
Thanks,
Alan
--
Alan Schmitt <http://sardes.inrialpes.fr/~aschmitt/>
The hacker: someone who figured things out and made something cool
happen.
.O.
..O
OOO
Arrrg! Trying to understand the format of bundle definitions.
Trouble number one: I'm trying to change the type of comments used for
plain text types. I've added the following to the patterns array of the
"Plain Text" language definition:
{ name = 'comment.line.right-angle-bracket.text';
match = '>.*$';
}
And nothing happens. I then tried creating a new bundle for a new type
of document ("Test Doc") and setting the patterns array to only the
above. Nothing.
What am I doing wrong?
Thanks if you can help!
Quinn
hello:)
Allan,since Texlive 2005 or Tetex 3 this code
I announce you that since Tex one should not any more
use this code (used in the Latex templates)
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse % we are not running PDFLaTeX
\else
\pdfoutput=1 % we are running PDFLaTeX
\pdftrue
\fi
must be replaced by \usepackage{ifpdf}
% Use: LaTeX: \usepackage{ifpdf}
% plain: \input ifpdf.sty
% The package provides the switch \ifpdf:
% \ifpdf
% ... do things, if pdfTeX is running in pdf mode ...
% \else
% ... other TeX or pdfTeX in dvi mode ...
% \fi
% The package can also be used to set global
% documentclass options:
% \RequirePackage{ifpdf}
% \ifpdf
% \documentclass[pdftex,...]{...}
% \else
% \documentclass[...]{...}
% \fi
note in texlive 2005 :
Last year, we kept \pdfoutput and other primitives undefined for DVI
output, even though
the pdfetex program was being used. This year, as promised, we undid
that compatibility
measure. So if your document uses \ifx\pdfoutput\undefined to test if
PDF is being
output, it will need to be changed. You can use the package ifpdf.sty
(which works under
both plain TEX and LATEX) to do this, or steal its logic.
Greetings
Alain
Hello all, hope to pick yer brains...
I notice that you can define multiple files for a template, but I can't
figure out how to create multiple files when running the template. Why
else would TM use multiple files in a template? But then again, there
seems to be only one $TM_NEW_FILE variable per template.
I'm trying to setup a template for a particular case when I will always
need several files at once. For now I'll just define one template for
each file I will need generated.
A quick side question, how can I populate env variables at runtime? If
my template has ${WHAT_DID_I_HAVE_FOR_LUNCH_TODAY} and I want to run a
template every day... is it possible to popup a dialog with fields to
fill-in or something?
Thanks!
Quinn
Strange Find and Replace Bug - r906
Summary:
Doing a selection based find and replace consistently inserts many lines
of code when it should be only replace one word with another single word.
Reproducing The Bug:
* Open the attached (.rb) file
* Switch to Ruby on Rails editor mode
* Do a full line selection on line #39
* Hit cmd+f to go into the finder window
* Replace the word ":now" with "now" while using the shift button to do
a selection only replace
Results:
* Replaces the entire line #39 with only the word "now"
* Performs a selection from line #39 down to #110
* Duplicates a bunch of code under line #110 (copies and pastes the new
selection)
Details:
* Ignore and wrap are checked. Reg exp. is unchecked.
* Restarting Textmate doesn't seem to fix the issue.
* Soyru in IRC helped me confirm the bug, so it is not specific to my
situation.
Environment:
* I don't use manager hacksies.
* I haven't edited the default bundle editor commands.
* I do use quicksilver, starting it is ctrl+alt+cmd+space; Everything
else is at defaults
class TimerController < ApplicationController
#
def index
unless @user.master_timer_is_stopped?
# initialize current task timer
# initialize task list
@upcoming_tasks = @user.upcoming_tasks
@recent_tasks = @user.recent_tasks
@favorite_tasks = @user.favorite_tasks
end
end
# Start a master timer
def start_clock
@user.start_master_timer
redirect_to :action => 'index'
end
# Pause a running master timer
def pause_clock
@user.pause_master_timer
redirect_to :action => 'index'
end
# Stop a running or paused master timer
def stop_clock
@user.stop_master_timer
redirect_to :action => 'index'
end
# Start a task
def start_task
# capture the time now so all timers match up
:now = Time.now
# find currently selected task
:selected_task = @user.selected_task
# if a selected task exists
if :selected_task
# if the recently started task is already the selected task
if :selected_task.id == params[:id]
if :selected_task.status == 2
# notice - can't start a timer that is already running
elsif :selected_task.status == 1
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = :selected_task.id
# change status of the this task
:selected_task.status = 2
:selected_task.save
else
# error - stopped tasks can't be selected
end
# if the recently started task is not already the selected task
else
# stop the task timer if it's still running
if :selected_task.status == 2
:task_timer = TaskTimer.find(:first,
:condition => "ended_at is null and " +
"user_id = #{(a)user.id} and " +
"task_id = #{:selected_task.id}")
:task_timer.ended_at = :now
:task_timer.save
end
#change status of selected task to stopped
:selected_task.status = 0
:selected_task.save
# find the newly started task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
# if no selected task exists
else
# find the newly selected task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
redirect_to :action => 'index'
end
private
before_filter :find_user
#
#
def find_user
@user = session[:user]
end
end
class TimerController < ApplicationController
#
def index
unless @user.master_timer_is_stopped?
# initialize current task timer
# initialize task list
@upcoming_tasks = @user.upcoming_tasks
@recent_tasks = @user.recent_tasks
@favorite_tasks = @user.favorite_tasks
end
end
# Start a master timer
def start_clock
@user.start_master_timer
redirect_to :action => 'index'
end
# Pause a running master timer
def pause_clock
@user.pause_master_timer
redirect_to :action => 'index'
end
# Stop a running or paused master timer
def stop_clock
@user.stop_master_timer
redirect_to :action => 'index'
end
# Start a task
def start_task
# capture the time now so all timers match up
now
# capture the time now so all timers match up
:now = Time.now
# find currently selected task
:selected_task = @user.selected_task
# if a selected task exists
if :selected_task
# if the recently started task is already the selected task
if :selected_task.id == params[:id]
if :selected_task.status == 2
# notice - can't start a timer that is already running
elsif :selected_task.status == 1
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = :selected_task.id
# change status of the this task
:selected_task.status = 2
:selected_task.save
else
# error - stopped tasks can't be selected
end
# if the recently started task is not already the selected task
else
# stop the task timer if it's still running
if :selected_task.status == 2
:task_timer = TaskTimer.find(:first,
:condition => "ended_at is null and " +
"user_id = #{(a)user.id} and " +
"task_id = #{:selected_task.id}")
:task_timer.ended_at = :now
:task_timer.save
end
#change status of selected task to stopped
:selected_task.status = 0
:selected_task.save
# find the newly started task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
# if no selected task exists
else
# find the newly selected task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
= Time.now
# find currently selected task
:selected_task = @user.selected_task
# if a selected task exists
if :selected_task
# if the recently started task is already the selected task
if :selected_task.id == params[:id]
if :selected_task.status == 2
# notice - can't start a timer that is already running
elsif :selected_task.status == 1
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = :selected_task.id
# change status of the this task
:selected_task.status = 2
:selected_task.save
else
# error - stopped tasks can't be selected
end
# if the recently started task is not already the selected task
else
# stop the task timer if it's still running
if :selected_task.status == 2
:task_timer = TaskTimer.find(:first,
:condition => "ended_at is null and " +
"user_id = #{(a)user.id} and " +
"task_id = #{:selected_task.id}")
:task_timer.ended_at = :now
:task_timer.save
end
#change status of selected task to stopped
:selected_task.status = 0
:selected_task.save
# find the newly started task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
# if no selected task exists
else
# find the newly selected task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
redirect_to :action => 'index'
end
private
before_filter :find_user
#
#
def find_user
@user = session[:user]
end
end