INNER CODE UNIT · Go

truncateString

vladimirvivien/ktop · application/app_ctrl.go:700

func truncateString(s string, max int) string {
	if len(s) <= max {
		return s
	}
	if max <= 3 {
		return s[:max]
	}
	return s[:max-3] + "..."
}

// getNamespaceDisplay returns the namespace display string based on filter state
func (app *Application) getNamespaceDisplay() string {
	// Check if filter is editing or active
	if app.panel.isNamespaceFilterEditing() {
		// Show filter input with cursor
		filterText := app.panel.getNamespaceFilter()
		if filterText == "" {
			return "[yellow]▌[-]"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…