Skip to content

Commit 7f63f00

Browse files
authored
REPL: make edit_title_case (M-c) call titlecase (JuliaLang#33851)
When edit_title_case was implemented, `uppercasefirst` (née `ucfirst`) and `titlecase` were doing the same transformation on only one word. But `titlecase` now transforms non-leading letters to lowercase, which is more expected for the M-c keyboard combo, as it's the standard readline behavior (I believe).
1 parent bbccbac commit 7f63f00

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stdlib/REPL/src/LineEdit.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ function edit_lower_case(s)
11031103
end
11041104
function edit_title_case(s)
11051105
set_action!(s, :edit_title_case)
1106-
return edit_replace_word_right(s, uppercasefirst)
1106+
return edit_replace_word_right(s, titlecase)
11071107
end
11081108

11091109
function edit_replace_word_right(s, replace::Function)

stdlib/REPL/test/lineedit.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ end
606606

607607
@testset "change case on the right" begin
608608
local buf = IOBuffer()
609-
edit_insert(buf, "aa bb CC")
609+
edit_insert(buf, "aa bB CC")
610610
seekstart(buf)
611611
LineEdit.edit_upper_case(buf)
612612
LineEdit.edit_title_case(buf)

0 commit comments

Comments
 (0)