ReCaseSelection changes the case of the currently selected text. Returns the new text; empty if nothing selected.
(c strcase.Cases)
| 443 | // ReCaseSelection changes the case of the currently selected text. |
| 444 | // Returns the new text; empty if nothing selected. |
| 445 | func (ed *Editor) ReCaseSelection(c strcase.Cases) string { |
| 446 | if !ed.HasSelection() { |
| 447 | return "" |
| 448 | } |
| 449 | sel := ed.Selection() |
| 450 | nstr := strcase.To(string(sel.ToBytes()), c) |
| 451 | ed.Buffer.ReplaceText(sel.Reg.Start, sel.Reg.End, sel.Reg.Start, nstr, EditSignal, ReplaceNoMatchCase) |
| 452 | return nstr |
| 453 | } |
nothing calls this directly
no test coverage detected