🎨 Keep the width when duplicating database table view field https://github.com/siyuan-note/siyuan/issues/11552

This commit is contained in:
Daniel 2024-06-10 16:25:57 +08:00
parent f1993e13e3
commit 68585e21e3
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 69 additions and 19 deletions

View file

@ -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)