From fea1a1adbb03d657724be9b9994ba6b11dfe625f Mon Sep 17 00:00:00 2001 From: Petter Rodhelind Date: Fri, 16 Mar 2018 12:33:26 +0100 Subject: Redesign. --- todo | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'todo') diff --git a/todo b/todo index d0aef98..bd8faa8 100644 --- a/todo +++ b/todo @@ -24,7 +24,32 @@ visual file stats with ^G keep tagline updated with flags show running processes in menu - another style for top menu do not change CurWin on mousepressed scroll on mpressed at bottom line unprintableChar styling + + + +--- + + +slice insertion + +func insert(original []int, position int, value int) []int { + l := len(original) + target := original + if cap(original) == l { + target = make([]int, l+1, l+10) + copy(target, original[:position]) + } else { + target = append(target, -1) + } + copy(target[position+1:], original[position:]) + target[position] = value + return target +} + + +s = append(s, 0) +copy(s[i+1:], s[i:]) +s[i] = x \ No newline at end of file -- cgit v1.2.3