On August 25, 2020 at 9:13 PM, "Rob McBroom" <mailinglist0(a)skurfer.com> wrote:
It doesn’t auto-indent after (, but that’s probably the language grammar.
I had a quick look, and yes, it's the grammar. Around line 367 this pattern, that I don't claim to understand the purpose of, gobbles up ()
{ begin = '(\()';
end = '(\))';
patterns = ( { include = '$self'; } );
},
before the pattern matching tuples around line 392 get a chance to process it
{ name = 'meta.structure.tuple.python';
match = '(\()(\s*(\)))';
captures = {
1 = { name = 'punctuation.definition.tuple.begin.python'; };
2 = { name = 'meta.empty-tuple.python'; };
3 = { name = 'punctuation.definition.tuple.end.python'; };
};
},
so, effectively, tuples aren't recognized by the grammar.
I deleted the first entry and got expansion of () working without any obvious destructive side-effects. YMMV.
Cheers,
Per
On August 25, 2020 at 9:13 PM, "Rob McBroom" <mailinglist0(a)skurfer.com> wrote:
I forget the details of the behavior I didn’t like before, but I use
disableIndentCorrections = 'emptyLines'
Give that a try. Python is my primary language and it mostly does what I want.
Thanks, that did the trick! This behaviour should probably be the default for python.
The exceptions:
It doesn’t auto-indent after (, but that’s probably the language grammar.
I though it would be just a matter of adding ( and ) to increase/decrease indent patterns, but that doesn't seem to have any effect whatsoever. In fact, removing the part of the increase/decrease indent pattern regexes matching [{ and }] doesn't change the current behaviour, so it seems that it is handled differently. Googling, I found a thread that suggests that auto-indent of paired [] and {} is based a macro triggered by the return key when in a certain scope:
http://textmate.1073791.n5.nabble.com/txmt-dev-Working-with-indentation-rul…
(about half-way down the conversation)
I say we need some authoritative advice here ;)
After a block like
class MyClass:
def action(self):
pass
⇥
Hitting ⇥ at the location shown above will line up with pass and not the previous def. I guess it’s doing the thing that makes sense, even though it’s never what I want and bites me almost daily.
Yeah, I agree. A bit ugly workaround is to add a snippet that applies when caret is in the leftmost position, e.g.:
`printf "%*s" ${TM_TAB_SIZE} ''`$0
and setting the scope selector to L:(source.python dyn.caret.begin.line) and key equivalent to ⇥.
This would obviously only work if you use spaces for tabs...
Cheers,
Per
Hi,
I have noticed a weird behavior with indentation that I'm pretty sure hasn't always been present (as it would have driven me nuts). I've only seen this with python files, and since I keep my own python3 bundle I removed that and installed the default python bundle with the same results.
Let me try to illustrate.
Using the settings
increaseIndentPattern = '^\s*(class|((async\s+)?(def|with|for))|elif|else|except|finally|if|try|while)\b.*:\s*$|(\{|\[)\s*$';
decreaseIndentPattern = '^\s*(elif|else|except|finally)\b.*:|^\s*(\}|\])';
disableIndentCorrections = :true;
indentOnPaste = 'simple';
I see the following behaviour (annotations where strange things happen):
if 1:
pass
else: # Expected this line to decrease indent when typing ':' (not OK)
pass
def foo():
def bar():
pass
return bar # I back up caret one level and type return (OK)
If I change disableIndentCorrections to :false, I get the following behaviour:
if 1:
pass
else: # Did decrease indent when typing ':' (OK)
pass
def foo(): # back up caret to col 0 and type def => auto-indent to align with previous non-empty line (not OK)
pass
# <- Force alignment to col 0, and retry
def foo():
def bar():
pass
return bar # I back up caret one level and type return => auto-indent to align with previous non-empty line (not OK)
FWIW, I scoured the installed bundles for any setting that might interfere, but did not find anything suspicious.
Is anyone else seeing the same behaviour, and if so, has it always been that way?
Is there something I can do to fix it?
Regards,
Per
Hallo,
I work with large amounts of database-output (from 10 to 200 MB), that I usually paste into a new opened TextMate window. When it is pasted, all works as expected. But pasting takes minutes. TM freezes and it takes much, much longer than other editors I tested (VIM, Atom, VS) until the text is visible and useable.
I find out, that this is caused by the Clipboard History. I never heard of this before and do not use it, because I have the Clipy-App for that. Nonetheless the size of the clipboard history file was 1.3 GB. If I clear the clipboard history (control + option + command +v and then "Clear History") everything works normally, but in my case the CH grows really fast. So once a day I have to clear the history.
In my opinion there are some solutions:
- Decoupling the pasting process and the CH process. The CH process should run in background with lower priority.
- Adding a setting to deactivate the CH. But in this case everybody, who use large text insertions run into this problems.
- Limit the size of the CH. But if people rely on this, that can cause problems.
My hardware:
- Macbook Pro 2013 with i7 and 16 GB RAM
- Macbook Pro 2016 with i5 and 8 GB RAM
same behavior on booth.
Thanks in advance
Nils
I'm trying to create a language bundle where it will not be possible to identify all the scopes correctly using regular expressions. Is there a way to generate the scope dynamically somehow?
I see there is a TextMate Ctags bundle (https://github.com/textmate/ctags.tmbundle). Does TextMate use CTags to locate and syntax color both functions and variables? Where does the file go and what name does it need to have?
Thanks,
John DeSoi, Ph.D.
Hey there,
I'm trying to figure out how to get back to a command's HTML window after
the command has finished. What I currently have works fine:
#!/usr/bin/env ruby18
require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/executor"
ENV['EDITOR'] = 'mate --wait'
TextMate::Executor.run("eyaml", "edit", "#{ENV['TM_FILEPATH']}")
I have Output set to show in a new HTML window and I do get the output
there. I'm just wondering if there's a way to get TM to automatically
return to the HTML window after I've closed the modified eyaml (so I don't
miss any error output for example).
Thanks,
George
I’ve been seeing things where a search gives what I know are incorrect
results, or worse, I’ll go for days thinking I’ve identified all the
references to some string in a project then find out I missed a few. I
think I’ve somewhat figured out how to reproduce it.
Selecting a folder in the File Browser and hitting ⇧⌘F mostly works
as expected, but if the Find dialog is already open, the “In:” field
doesn’t update.
If you perform the search anyway, it seems to sometimes search the
original location (still displayed) and sometimes search what you had
selected in the File Browser, even though that isn’t displayed. I
swear it searches the entire project sometimes as well, but I could be
wrong about that.
In any case, something isn’t quite right. Thanks.
--
Rob McBroom
I updated a PostgreSQL bundle with new keywords for the latest version. As far as I can tell there is no difference except the the new version has quite a few more keywords. But the bundle editor syntax coloring now indicates there are errors after this specification. Is there a string length limit or some other way to fix it? As far as I can tell the bundle is working find and all keywords are recognized.
John DeSoi, Ph.D.
old
<key>match</key>
<string>(?xi)\b(abort|absolute|access|action|add|admin|after|aggregate|all|also|alter|always|analyse|analyze|and|any|array|as|asc|assertion|assignment|asymmetric|at|attribute|authorization|backward|before|begin|between|bigint|binary|bit|boolean|both|by|cache|called|cascade|cascaded|case|cast|catalog|chain|char|character|characteristics|check|checkpoint|class|close|cluster|coalesce|collate|collation|column|comment|comments|commit|committed|concurrently|configuration|connection|constraint|constraints|content|continue|conversion|copy|cost|create|cross|csv|current|current_catalog|current_date|current_role|current_schema|current_time|current_timestamp|current_user|cursor|cycle|data|database|day|deallocate|dec|decimal|declare|default|defaults|deferrable|deferred|definer|delete|delimiter|delimiters|desc|dictionary|disable|discard|distinct|do|document|domain|double|drop|each|else|enable|encoding|encrypted|end|enum|escape|event|except|exclude|excluding|exclusive|execute|exists|explain|extension|external|extract|false|family|fetch|first|float|following|for|force|foreign|forward|freeze|from|full|function|functions|global|grant|granted|greatest|group|handler|having|header|hold|hour|identity|if|ilike|immediate|immutable|implicit|in|including|increment|index|indexes|inherit|inherits|initially|inline|inner|inout|input|insensitive|insert|instead|int|integer|intersect|interval|into|invoker|is|isnull|isolation|join|key|label|language|large|last|lateral|lc_collate|lc_ctype|leading|leakproof|least|left|level|like|limit|listen|load|local|localtime|localtimestamp|location|lock|mapping|match|materialized|maxvalue|minute|minvalue|mode|month|move|name|names|national|natural|nchar|next|no|none|not|nothing|notify|notnull|nowait|null|nullif|nulls|numeric|object|of|off|offset|oids|on|only|operator|option|options|or|order|out|outer|over|overlaps|overlay|owned|owner|parser|partial|partition|passing|password|placing|plans|position|preceding|precision|prepare|prepared|preserve|primary|prior|privileges|procedural|procedure|program|quote|range|read|real|reassign|recheck|recursive|ref|references|refresh|reindex|relative|release|rename|repeatable|replace|replica|reset|restart|restrict|returning|returns|revoke|right|role|rollback|row|rows|rule|savepoint|schema|scroll|search|second|security|select|sequence|sequences|serializable|server|session|session_user|set|setof|share|show|similar|simple|smallint|snapshot|some|stable|standalone|start|statement|statistics|stdin|stdout|storage|strict|strip|substring|symmetric|sysid|system|table|tables|tablespace|temp|template|temporary|text|then|time|timestamp|to|trailing|transaction|treat|trigger|trim|true|truncate|trusted|type|types|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|unlogged|until|update|user|using|vacuum|valid|validate|validator|value|values|varchar|variadic|varying|verbose|version|view|volatile|when|where|whitespace|window|with|without|work|wrapper|write|xml|xmlattributes|xmlconcat|xmlelement|xmlexists|xmlforest|xmlparse|xmlpi|xmlroot|xmlserialize|year|yes|zone)\b</string>
new
<key>match</key>
<string>(?xi)\b(abort|absolute|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|analyse|analyze|and|any|anyarray|anyelement|anyenum|anynonarray|anyrange|array|as|asc|assertion|assignment|asymmetric|at|attach|attribute|authorization|backward|before|begin|between|bigint|binary|bit|bool|boolean|both|box|bpchar|by|bytea|cache|call|called|cascade|cascaded|case|cast|catalog|chain|char|character|characteristics|check|checkpoint|cid|cidr|circle|class|close|cluster|coalesce|collate|collation|column|columns|comment|comments|commit|committed|concurrently|configuration|conflict|connection|constraint|constraints|content|continue|conversion|copy|cost|create|cross|cstring|csv|cube|current|current_catalog|current_date|current_role|current_schema|current_time|current_timestamp|current_user|cursor|cycle|data|database|date|daterange|day|deallocate|dec|decimal|declare|default|defaults|deferrable|deferred|definer|delete|delimiter|delimiters|depends|desc|detach|dictionary|disable|discard|distinct|do|document|domain|double|drop|each|else|enable|encoding|encrypted|end|enum|escape|event|event_trigger|except|exclude|excluding|exclusive|execute|exists|explain|extension|external|extract|false|family|fdw_handler|fetch|filter|first|float|float4|float8|following|for|force|foreign|forward|freeze|from|full|function|functions|generated|global|grant|granted|greatest|group|grouping|groups|gtsvector|handler|having|header|hold|hour|identity|if|ilike|immediate|immutable|implicit|import|in|include|including|increment|index|index_am_handler|indexes|inet|inherit|inherits|initially|inline|inner|inout|input|insensitive|insert|instead|int|int2|int2vector|int4|int4range|int8|int8range|integer|internal|intersect|interval|into|invoker|is|isnull|isolation|join|json|jsonb|jsonpath|key|label|language|language_handler|large|last|lateral|leading|leakproof|least|left|level|like|limit|line|listen|load|local|localtime|localtimestamp|location|lock|locked|logged|lseg|macaddr|macaddr8|mapping|match|materialized|maxvalue|method|minute|minvalue|mode|money|month|move|name|names|national|natural|nchar|new|next|no|none|not|nothing|notify|notnull|nowait|null|nullif|nulls|numeric|numrange|object|of|off|offset|oid|oids|oidvector|old|on|only|opaque|operator|option|options|or|order|ordinality|others|out|outer|over|overlaps|overlay|overriding|owned|owner|parallel|parser|partial|partition|passing|password|path|pg_attribute|pg_auth_members|pg_authid|pg_class|pg_database|pg_ddl_command|pg_dependencies|pg_lsn|pg_mcv_list|pg_ndistinct|pg_node_tree|pg_proc|pg_shseclabel|pg_subscription|pg_type|placing|plans|point|policy|polygon|position|preceding|precision|prepare|prepared|preserve|primary|prior|privileges|procedural|procedure|procedures|program|publication|quote|range|read|real|reassign|recheck|record|recursive|ref|refcursor|references|referencing|refresh|regclass|regconfig|regdictionary|regnamespace|regoper|regoperator|regproc|regprocedure|regrole|regtype|reindex|relative|release|rename|repeatable|replace|replica|reset|restart|restrict|returning|returns|revoke|right|role|rollback|rollup|routine|routines|row|rows|rule|savepoint|schema|schemas|scroll|search|second|security|select|sequence|sequences|serializable|server|session|session_user|set|setof|sets|share|show|similar|simple|skip|smallint|snapshot|some|sql|stable|standalone|start|statement|statistics|stdin|stdout|storage|stored|strict|strip|subscription|substring|support|symmetric|sysid|system|table|table_am_handler|tables|tablesample|tablespace|temp|template|temporary|text|then|tid|ties|time|timestamp|timestamptz|timetz|to|trailing|transaction|transform|treat|trigger|trim|true|truncate|trusted|tsm_handler|tsquery|tsrange|tstzrange|tsvector|txid_snapshot|type|types|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|unlogged|until|update|user|using|uuid|vacuum|valid|validate|validator|value|values|varbit|varchar|variadic|varying|verbose|version|view|views|void|volatile|when|where|whitespace|window|with|within|without|work|wrapper|write|xid|xml|xmlattributes|xmlconcat|xmlelement|xmlexists|xmlforest|xmlnamespaces|xmlparse|xmlpi|xmlroot|xmlserialize|xmltable|year|yes|zone)\b</string>
Hello,
I am using TextMate along with nvALT. I will open a file in Textmate from nvALT with the edit with functionality. If I accidentally modify the file in nvALT while it's open in TextMate, TextMate doesn't reload the file.
BBEdit does do this though.
I really don't like BBEdit that much, so I don't want to use that. Is there an option somewhere to enable this functionality? If not, is it possible to submit a feature request to enable the functionality?
Thanks