mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
🎨 Keep the width when duplicating database table view field https://github.com/siyuan-note/siyuan/issues/11552
This commit is contained in:
parent
f1993e13e3
commit
68585e21e3
5 changed files with 69 additions and 19 deletions
|
|
@ -19,11 +19,8 @@ package av
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
|
@ -644,20 +641,6 @@ func (av *AttributeView) GetBlockKey() (ret *Key) {
|
|||
return
|
||||
}
|
||||
|
||||
func (av *AttributeView) GetDuplicateViewName(masterViewName string) (ret string) {
|
||||
ret = masterViewName + " (1)"
|
||||
r := regexp.MustCompile("^(.*) \\((\\d+)\\)$")
|
||||
m := r.FindStringSubmatch(masterViewName)
|
||||
if nil == m || 3 > len(m) {
|
||||
return
|
||||
}
|
||||
|
||||
num, _ := strconv.Atoi(m[2])
|
||||
num++
|
||||
ret = fmt.Sprintf("%s (%d)", m[1], num)
|
||||
return
|
||||
}
|
||||
|
||||
func (av *AttributeView) ShallowClone() (ret *AttributeView) {
|
||||
ret = &AttributeView{}
|
||||
data, err := gulu.JSON.MarshalJSON(av)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue