Skip to content

Commit

Permalink
Merge pull request #74 from JuliaDebug/vc/fixup_tm
Browse files Browse the repository at this point in the history
Fix TerminalMenu difference in APO
  • Loading branch information
vchuravy authored Apr 9, 2020
2 parents 6e8b5e4 + b983c2b commit f4ffcc4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Cthulhu"
uuid = "f68482b8-f384-11e8-15f7-abe071a5a75f"
authors = ["Valentin Churavy <[email protected]>"]
version = "1.0.1"
version = "1.0.2"

[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
Expand Down
12 changes: 12 additions & 0 deletions src/ui.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ function TerminalMenus.pick(menu::CthulhuMenu, cursor::Int)
return true #break out of the menu
end

function TerminalMenus.writeLine(buf::IOBuffer, menu::CthulhuMenu, idx::Int, cursor::Bool)
cursor_len = length(TerminalMenus.CONFIG[:cursor])
# print a ">" on the selected entry
cursor ? print(buf, TerminalMenus.CONFIG[:cursor]) : print(buf, repeat(" ", cursor_len))
print(buf, " ") # Space between cursor and text

line = replace(menu.options[idx], "\n" => "\\n")

print(buf, line)
end

# This used to be the original method, the above is for compatibility with Base.REPL
function TerminalMenus.writeLine(buf::IOBuffer, menu::CthulhuMenu, idx::Int, cursor::Bool, term_width::Int)
cursor_len = length(TerminalMenus.CONFIG[:cursor])
# print a ">" on the selected entry
Expand Down

2 comments on commit f4ffcc4

@vchuravy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/12661

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.2 -m "<description of version>" f4ffcc4ed919061e7772656695eabcba192cc147
git push origin v1.0.2

Please sign in to comment.