 // MARK: - main controller
 class TemplatesPrefsController: NSViewController {
 	let templatePasteboardType = NSPasteboard.PasteboardType(rawValue: "io.rc2.client.codeTemplate")
-
+	//>>>
+	var last = ""
+	
 	// MARK: properties
 	@IBOutlet private var splitterView: NSSplitView!
 	@IBOutlet private var markdownButton: NSButton!

		// wrapper is not identical object
		guard let wrapperData = info.draggingPasteboard().data(forType: templatePasteboardType),
			let wrapper = try? JSONDecoder().decode(DragData.self, from: wrapperData)
			else { Log.warn("asked to validate invalid drag data", .app); return false }
//		let srcIndex = outlineView.childIndex(forItem: wrapper.item)
		let destObj = parentItem as? CodeTemplateObject
		let isCopy = info.draggingSourceOperationMask() == .copy
		if wrapper.isCategory {
			let srcIndex = wrapper.indexPath[0]
			print("dropping on \(destObj?.description ?? "nil") idx \(index) from \(wrapper.indexPath)")
			var destIndex = (index == -1) ? currentCategories.count - 1 : index
			if isCopy {
				let newCat = CodeTemplateCategory(wrapper.category!)
				currentCategories.insert(newCat, at: destIndex)
				codeOutlineView.insertItems(at: IndexSet(integer: destIndex), inParent: nil, withAnimation: .effectGap)
			} else {
				currentCategories.moveElement(from: srcIndex, to: destIndex)
				if destIndex >= currentCategories.count { destIndex -= 1 }
				codeOutlineView.moveItem(at: srcIndex, inParent: nil, to: destIndex, inParent: nil)
			}
			return true
		}
		return false


// MARK: - NSOutlineViewDataSource
extension TemplatesPrefsController: NSOutlineViewDataSource {
	
	func outlineView(_ outlineView: NSOutlineView, numberOfChildrenOfItem item: Any?) -> Int {
		if item == nil { return currentCategories.count }
		guard let category = item as? CodeTemplateCategory else { return 0 }
