Should TaskPaper try to be smart about detecting leading spaces and turning them into tabs? TaskPaper If it were me making the decision, though, I’d normalise on tabs and Unix line breaks. The ideal from an arbitrary user’s point of view would presumably be to preserve what they have. In each case, these are normalised file-wide when saving. REPLACING TABS WITH SPACES IN BBEDIT MACSimilarly, it defaults to Unix line breaks, but can be configured to use Windows or even classic Mac breaks too. When saving, indentation will always be in tabs. Having said that, normalisation is a good thing, and I imagine that it’s a minority of users who are creating or editing the files outside of TaskPaper itself (a vocal minority, certainly, since they’ll be scripters and devs and hackers, but still a minority).įor what it’s worth, TaskPaperRuby normalises the content when saving, but accepts mixed input using a default of either four spaces (configurable) or one tab per indentation level. There are issues with exactly how you “detect” what they’re using, and what to do in the event of multiple different methods being used in the same file (do you preserve per-line?). I suppose that ideally the file’s existing formatting would be preserved. Right now TaskPaper recognizes multiple types of line endings, but always saves using \n. Note These a similar question relating to line endings. Only consider leading tabs when parsing for indentation… just read file in and be done with it?Ĭonsider both leading tabs and spaces when parsing for indentation… but always save using tabs?Ĭonsider both leading tabs and spaces when parsing for indentation… and save out using detected method? Programmers and scripters ( what do you think: That would be idea from the individual users perspective, but it would make parsing TaskPaper files more complex, since parsers would have to take into consideration multiple indentation methods. Tabs, two spaces, four spaces, etc… and then when saving encode the indentation using the same method. I guess the “ideal” behavior would be to detect and remember the indentation method. The problem with this behavior (besides the fact that’s it’s buggy) is that it means if you open a file in TaskPaper, and then save it, spaces get converted into tabs even if you make no edits. Visually you would have some indication that there isn’t a hierarchy, since the guide lines and leading bullets would all be left aligned, but still I’m sure it would be confusing. If such a file is opened in TaskPaper without conversion then it will visually look like there’s a hierarchy because of the leading spaces, but none of the hierarchy commands will work (such as expand collapse), because there will be no hierarchy in TaskPaper’s model. Lots of text editor default to using leading spaces for indentation. REPLACING TABS WITH SPACES IN BBEDIT CODERight now I have some buggy code that tries to automatically convert from leading space indentation to tab indentation when reading a file into TaskPaper. Continuing the discussion from Multiple spaces are replaced by tabs:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |