sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Kramdown::Utils::StringScanner#current_line_number
Returns the line number for current charpos. NOTE: Requires that all line endings are normalized to '\n' NOTE: Normally we'd have to add one to the count of newlines to get the correct line number. However we add the one indirectly by using a one-based start_line_number.
Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/kramdown-2.1.0/lib/kramdown/utils/string_scanner.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Kramdown--Utils--StringScanner-current_line_number-for-pr
# Commit to gitgit add app/server/ruby/vendor/kramdown-2.1.0/lib/kramdown/utils/string_scanner.rbgit commit -m "better docs for Kramdown::Utils::StringScanner#current_line_number"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Kramdown--Utils--StringScanner-current_line_number-for-pr
hub pull-request
# Celebrate!