FoldingText 2.1 Dev (741)

I think this should already be working?

And in your general case of putting back ticks around text… instead of manually inserting them just select the text and do Format > Code.

This sounds neat, but I’m not sure it’s worth the implementation work, bugs, etc. I’m not sure if anyone would find it, and even my programmers Sublime text editor doesn’t seem to do anything special like that.

In the specific case of Backticks (which do inline code formatting) you can delete them automatically using Edit > Clear Formatting. You don’t even need to select all the text. If there’s interest I think a similar command (clear brackets) would be pretty easy to add and it wouldn’t make the existing autocompletion of brackets any more complicated.

Yes, I’ll remove single quotes from the smart pairs implementation. I agree a check to see if proceeding character is alphanumeric seems reasonable, I’ll look into it.

Is there an option do disable smart pairs? : )

And I think that links with underscores in them don’t open when you click on them

Can you please add the support for * instead of _ for marking text as italic ?

Can you please add the support for * instead of _ for marking text as italic ?

In the meanwhile you could assign this to a keystroke:

property pstrJS : "
	function(editor) {
		editor.toggleSelectionFormatting(editor, '*');
	}
"
tell application "FoldingText"
	set lstDocs to documents
	if lstDocs ≠ {} then tell item 1 of lstDocs to (evaluate script pstrJS)
end tell

Thanks, but this is too complicated. I hope that we can see * instead of _ soon. Most apps use * for Markdown and I am used to that.

* happens to be my personal preference for italics too.

I had been typing *them* manually (FT does, of course, already recognise asterisk-delimited strings and display them as italicised) but prompted by your post I’ve now assigned ⌘I in FT to Italicise the selection with * using the KeyBoard Maestro macro in the utilities folder of this repository.

(zip file for the repository)

Just a note… I’ve added a preference for this in next release.

any news about 2.1? Is it ready for MAS?

No I need to still post at least another beta before that. Probably 2 more then MAS.

Hey Jesse, Been quiet of late as life has taken over from FT beta stuff for a few months. Looks like things are moving along at a rapid pace.

Quick reminder. You mentioned you were going to look at improving the core outliner functionality immediately after the 2.0 public release. The early talk was about maybe having an external palette to drag/drop the structure of your doc. Hoping this is still on your radar.

Cheers,

jm

Nothing to show at the moment, but yes this is very much on my radar at the moment.

Splendid news. :smile:

Hey Jesse: is full tag auto-completion going to happen in a release coming soon? Not bugging, just wondering how high it is on your priority list or whether I should attempt to hack together some kind of plugin…

The ftfilter plugin does support tag auto-completion already (https://github.com/jamiekowalski/foldingtext-extra/tree/master/filter.ftplugin). Maybe you can borrow some ideas from there.

Thanks, Sven— that was what I actually had in mind as a starting point for hacking something together!

In other news: 2.1 DEV 741 is telling me that it’s expired. Looking forward to 742, or perhaps 2.2…?

UPDATE: scratch that comment about the expiration notice. I’d tried out a disk cleaning utility and must have unwittingly cleaned out some caches or installation logs…

Also: is it just me or does FoldingText not always maintain tab depths for copied text?

It does copy its own tab depths (or are you thinking of pasting into FT ?)

But of course the hash heading vs list difference means that its tab counts don’t map directly onto nesting levels.

If you want to copy an FT outline in a way that could be pasted (for example into TaskPaper), with full preservation of nesting levels (and of project/header status for hashed lines), you could do something like this:

-- Copy FT selection with full indentation (and trailling colon for project/headings) for TP pasting
property pstrJS : "

	function(editor, options) {

		function nestLevel(oNode) {
			var lngLevel=0;
			while (oNode.parent) {
				lngLevel++;
				oNode = oNode.parent;
			}
			return lngLevel;
		}

		var lstNodes = editor.selectedRange().nodesInRange(),
			lstLines=[], varNode, strLine, strSuffix;

		lstNodes.forEach(function (varNode) {
			strLine = varNode.line().trim();
	
			if (varNode.type() !== 'heading') strSuffix='';
			else strSuffix=':';

			lstLines.push([Array(nestLevel(varNode)).join('\\t'), strLine, strSuffix].join(''));
		});
		return lstLines.join('\\n');
	}

"

on run
	set varResult to missing value
	tell application "FoldingText"
		set lstDocs to documents
		if lstDocs ≠ {} then
			tell item 1 of lstDocs to set varResult to (evaluate script pstrJS)
			set the clipboard to varResult
		end if
	end tell
	return varResult
end run


Thought I’d fixed it, but I’m still getting an expiration notice on 2.1dev741, even though I’ve purchased via the App store. My guess is that I’ve overwritten something after my upgrade to Yosemite— can anyone suggest a pointer in the right direction?

Thanks in advance for any suggestions.

(…and if you’ve seen my other posts this morning, apologies for storming the board, just clearing a few issues from the queue!)