<commit_before>'use babel'

const pxReg = /^[+-]?([0-9]*[.])?[0-9]+(p|px)$/

export default {
    selector: '.source.css, .source.less, .source.scss, .source.sass, .source.styl',
    disableForSelector: '.source.css .comment, .source.css .string, .source.sass .comment, .source.sass .string, .source.less .comment, .source.less .string, .source.styl .comment, .source.styl .string, .source.scss .comment, .source.scss .string',
    getSuggestions({editor, bufferPosition, prefix}) {
        const lineNum = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition])

        if(pxReg.test(prefix)){
            let num = parseFloat(prefix)
            if(num <= 1) return
            num = Number((num / atom.config.get('pxrem.base')).toFixed(atom.config.get('pxrem.length')))
            return [{
                text: `${num}rem`
            }]
        }
    }
}<commit_msg>Fixed float support<commit_after>'use babel'

const pxReg = /[+-]?([0-9]*[.])?[0-9]+(p|px)$/

export default {
    selector: '.source.css, .source.less, .source.scss, .source.sass, .source.styl',
    disableForSelector: '.source.css .comment, .source.css .string, .source.sass .comment, .source.sass .string, .source.less .comment, .source.less .string, .source.styl .comment, .source.styl .string, .source.scss .comment, .source.scss .string',
    getSuggestions({editor, bufferPosition}) {
        const lineText = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition])
        const matches = pxReg.exec(lineText)

        if(matches){
            let num = parseFloat(matches[0])
            if(num <= 1) return
            num = Number((num / atom.config.get('pxrem.base')).toFixed(atom.config.get('pxrem.length')))
            return [{
                text: `${num}rem`
            }]
        }
    }
}
{'fraction_non_alphanumeric': 0.1792452830188679, 'fraction_numerical': 0.007214206437291898, 'mean_word_length': 2.606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6848310', 'n_tokens_mistral': 598, 'n_tokens_neox': 590, 'n_words': 114}