Hi,
I don't suppose it would be possible for Textmate to make an attempt to 'guess' the tab size (and whether the file is using hard/soft tabs) when a file is opened? I often wind up editing other people's code and, usually, they wind up using something other than 'soft tabs: 2'. So I regularly have to fiddle with the tab size to make things match up nicely.
ISTR a previous editor I've used, WingIDE[1], having this feature, and it was really handy... And no, that's not an 'every other editor does it' -- it's the only time I've seen that feature, but it was really useful!
Oh, even better! I'm looking at the code for Typo just now, and it's not even consistent throughout the code! In fact most of it is 'soft tabs: 2', just views/articles/taglist.rhtml (the first one I happened to want to edit) that's using hard tabs...
On 16/11/2005, at 8.21, Graeme Mathieson wrote:
I don't suppose it would be possible for Textmate to make an attempt to 'guess' the tab size (and whether the file is using hard/ soft tabs) when a file is opened? [...]
The thought has crossed my mind -- my main concern is with how to properly indicate to the user that he's not using his default setting -- I was thinking something along the lines of highlighting the tab size setting in the status bar.
Hi,
for a mistake I dragged a bmp image (about 1 mb) to a TextMate window: apparently the computer hang for about ten minutes, then in the window appeared about 4000 lines of text, then TM close. I repeat a second time with another image: now computer take always about ten minutes to give me the control, but this time TM doesn't crash.
Perhaps it should be better to handle these mistakes and tell, i. e., "you could not insert bmp image..." :-)
I've 1.1.b17 (753 version) on a powerbook G4 1.67 GHz with 512 mb ram
On 16.11.2005, at 18:22, salvo wrote:
for a mistake I dragged a bmp image (about 1 mb) to a TextMate window: apparently the computer hang for about ten minutes, then in the window appeared about 4000 lines of text, then TM close. I repeat a second time with another image: now computer take always about ten minutes to give me the control, but this time TM doesn't crash.
Concerning responsiveness: It would greatly enhance the responsiveness of this list if you would stop messing the threading up. So please do _not_ use the reply button in your mail program, but just write a new mail to textmate@lists.macromates.com if you want to start a new thread. Otherwise the universe will collapse (as noted in the footer) and we really don't want that.
I think the delay is caused by what Allan explained about 4 days ago: TextMate doesn't handle long lines very good if you don't enable soft wrap. And because there are rather few line breaks in BMPs, TextMate sucks at editing 1 MB BMPs. But why would you want to do that anyway, exept by mistake?
Perhaps it should be better to handle these mistakes and tell, i. e., "you could not insert bmp image..." :-)
Maybe TextMate could recognize binary files in general (not just BMPs, that would be rather silly) and kindly ask me about that, Allan? Or could it auto-enable soft wrap for files where long lines would cause problems? Although I'm not sure how to recognize these files in advance.
Jonas
On 16/11/2005, at 18.49, Jonas Witt wrote:
Maybe TextMate could recognize binary files in general (not just BMPs, that would be rather silly) and kindly ask me about that, Allan?
It does do that for files clicked from the project drawer (actually all non-UTF 8 files).
Or could it auto-enable soft wrap for files where long lines would cause problems?
I'll likely just force wrap after column 1000 or so (in the future)…
On 11/16/05, Allan Odgaard throw-away-1@macromates.com wrote:
On 16/11/2005, at 8.21, Graeme Mathieson wrote:
I don't suppose it would be possible for Textmate to make an attempt to 'guess' the tab size (and whether the file is using hard/ soft tabs) when a file is opened? [...]
The thought has crossed my mind -- my main concern is with how to properly indicate to the user that he's not using his default setting -- I was thinking something along the lines of highlighting the tab size setting in the status bar.
I hesitate to suggest this, but how about modlines ala emacs or vim? /* vim:set ts=4 sw=4 nowrap: */
Does eliminate the guessing, anyway. Though some indicator that defaults have been overridden would still be useful. What other clue would textmate use anyway?
On 16/11/2005, at 19.16, chris feldmann wrote:
I hesitate to suggest this, but how about modlines ala emacs or vim? /* vim:set ts=4 sw=4 nowrap: */
Eventually I'll probably support something like that -- but generally other users haven't made the proper settings lines in their files. I.e. the problem with wrong tab size happens when opening some random file from the net (or friend).
What other clue would textmate use anyway?
It can check the ratio for spaces versus tabs in the file to figure out if soft tabs should be enabled. If soft tabs are enabled, it can look at a few lines to figure out the size.
It won't be able to figure out the tab size (for hard tabs), but this is less important. I.e. the main problem is inserting spaces in a tabbed file or vice versa, and for spaces, inserting the wrong number of spaces for indent.
Now if just everybody would use hard tabs (as God intended), there would be no problems :) one would still need to set the proper size, but no-one would “destroy” the file by editing it with wrong settings.
On 16 Nov 2005, at 18:16, chris feldmann wrote:
I hesitate to suggest this, but how about modlines ala emacs or vim? /* vim:set ts=4 sw=4 nowrap: */
Yep, it would be nice to honour them too, since a number of the files I edit (from when I used to use XEmacs) do have settings stashed away like that.
But in the absence of any obvious clues like that, some heuristic to figure it out (then maybe highlighting the tabs indicator in the status bar in red or something?) would be really useful.
Then again, nothing could possibly guess the correct indentation for the dodgy piece of HTML I'm editing just now, which has a mixture of tabs, spaces (varying amounts of indentation at that!). I suppose that's what happens when you let the marketing folks near the web site...!
+1 : methinks it smart to honour existing standards.
I usually work with invisibles on, which Just Works for me. The invisibles settle very nicely into the background, but its obvious if something's up.
actually Allan, how about setting invisibles on if the user's tab settings are overridden? it'd get the point across, and as i mentioned i think they're commendably unobtrusive ornaments
cheers, David
On 18/11/2005, at 9:54 PM, Graeme Mathieson wrote:
On 16 Nov 2005, at 18:16, chris feldmann wrote:
I hesitate to suggest this, but how about modlines ala emacs or vim? /* vim:set ts=4 sw=4 nowrap: */
Yep, it would be nice to honour them too, since a number of the files I edit (from when I used to use XEmacs) do have settings stashed away like that.
But in the absence of any obvious clues like that, some heuristic to figure it out (then maybe highlighting the tabs indicator in the status bar in red or something?) would be really useful.
Then again, nothing could possibly guess the correct indentation for the dodgy piece of HTML I'm editing just now, which has a mixture of tabs, spaces (varying amounts of indentation at that!). I suppose that's what happens when you let the marketing folks near the web site...! -- Mail: mathie@woss.name | Web: http://woss.name/ AIM: Math1e | PGP: 1024D/D72F2737
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Hi all,
I have just bought TextMate and I am puzzled with a trivial question.
[...] user's tab settings [...]
Where can I fix the tab setting to match 4 spaces in all the documents I open?
On some documents it happens to be 4 spaces; on other documents 3 spaces. I thought it was an extension based configuration, but I could not find any such option anyware.
Can anyone share some knowledge with me?
I thought it was an extension based configuration
guess what -- you're right :) open a Terminal window and type defaults delete com.macromates.textmate OakTextViewScopedTabSize to reset them all. in the com.macromates.textmate domain you'll find lotsa interesting stuff. hope this helps!
ciao,
Domenico
On 5/12/2005, at 21:22, Domenico Carbotta wrote:
I thought it was an extension based configuration
guess what -- you're right :) open a Terminal window and type defaults delete com.macromates.textmate OakTextViewScopedTabSize to reset them all.
Of course the way I expected people to adjust tab size was by using the pop-up in the status bar :)
By default TM has different settings for a few known scopes (Ruby: 2, Markdown: 4, Old-style Property List: 4, ...). If your preference is e.g. 6, you may need to set it for a few different types before it's 6 for all file types -- it tries to be smart, so if you open a file for which you haven't set an explicit size, and TM doesn't ship with a default size for that file type, then it uses the setting of the “closest” file type (e.g. source.ruby.rails is closest to source.ruby), and if nothing is closest, it uses the size you most recently set explicitly.
So the times you need to “correct” the tab size should be down to a minimum, while still offering per-file type tab settings.
Hi Allan, ciao Domenico,
thank you for your replies.
I completely missed the status-bar. I usually look for setting/preferences on the top side of the windows, and did not see the bar until after reading you message. :-)
The set-up (once found) is quite handy, but I am quite "integralist" on tab setting (you can set it to any value you what as long as it is 4) I would like to have also an explicit global setting, to avoid the guessing you are doing now.
Anyway I can live with the current solution; I have just started using TextMate (mostly for the project drawer) even if I am quite comfortable with plain old text editor (I'm still using SubEthaEdit with great pleasure). TextMate seems following a different philosophy, and I hope to get it right while using it.
Thanks again for your answers.
Giulio Cesare
On 12/5/05, Allan Odgaard throw-away-1@macromates.com wrote:
On 5/12/2005, at 21:22, Domenico Carbotta wrote:
I thought it was an extension based configuration
guess what -- you're right :) open a Terminal window and type defaults delete com.macromates.textmate OakTextViewScopedTabSize to reset them all.
Of course the way I expected people to adjust tab size was by using the pop-up in the status bar :)
By default TM has different settings for a few known scopes (Ruby: 2, Markdown: 4, Old-style Property List: 4, ...). If your preference is e.g. 6, you may need to set it for a few different types before it's 6 for all file types -- it tries to be smart, so if you open a file for which you haven't set an explicit size, and TM doesn't ship with a default size for that file type, then it uses the setting of the "closest" file type (e.g. source.ruby.rails is closest to source.ruby), and if nothing is closest, it uses the size you most recently set explicitly.
So the times you need to "correct" the tab size should be down to a minimum, while still offering per-file type tab settings.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Hello Allan
On 16.11.05, you wrote:
I don't suppose it would be possible for Textmate to make an attempt to 'guess' the tab size (and whether the file is using hard/ soft tabs) when a file is opened? [...]
The thought has crossed my mind -- my main concern is with how to properly indicate to the user that he's not using his default setting -- I was thinking something along the lines of highlighting the tab size setting in the status bar.
There could be support for an external indent (e.g. http://www.gnu.org/software/indent/indent.html) and some "Re-indent" command setting (makes sense for C bundle at least). Just as idea.
regards,
On 16/11/2005, at 23.22, Christian Rosentreter wrote:
There could be support for an external indent
You can easily do that as a command.
[...] and some "Re-indent" command setting
There is such in the Text menu.
However, the problem here is, you edit a friends file, he uses hard tabs, you use soft tabs, and you won't notice that you're now inserting lots of spaces in his tabbed file.
The other way around, it would be noticeable though.