Sigrid Haflínudóttircopy48a5e776 years agoHistory
29 lines · 1.1 KB · Go
RawDownload
// Copyright 2016 Viacheslav Chimishuk <vchimishuk@yandex.ru>//// This file is part of Chub.//// Chub is free software: you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation, either version 3 of the License, or// (at your option) any later version.//// Chub is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with Chub. If not, see <http://www.gnu.org/licenses/>. package cue // stringTruncateMaybe truncates string up to newLen characters if string truncation// is enabled.// If given string is shorter than newLen if will be returned without any changes.func (sheet *Sheet) stringTruncateMaybe(str string, newLen int) string {	if len(str) > newLen && (sheet.flags&FlagTruncateStrings) != 0 {		return str[:newLen]	} 	return str}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t