diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-03-16 12:33:26 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-03-16 12:33:26 +0100 |
commit | fea1a1adbb03d657724be9b9994ba6b11dfe625f (patch) | |
tree | 59632674ec570a8f1db6d3154ce49b255ac63b6e /todo | |
parent | 2395485d075f80117fe3ce25ef339bb1ffecf160 (diff) | |
download | poe-fea1a1adbb03d657724be9b9994ba6b11dfe625f.tar.gz poe-fea1a1adbb03d657724be9b9994ba6b11dfe625f.tar.bz2 poe-fea1a1adbb03d657724be9b9994ba6b11dfe625f.zip |
Redesign.
Diffstat (limited to 'todo')
-rw-r--r-- | todo | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -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 |