<commit_before>{LTool,get_tex_root} = require './ltutils'
{exec, execFile} = require 'child_process'
path = require 'path'

module.exports =

class Viewer extends LTool


  _jumpWindows: (texfile, pdffile, row, col, forward_sync, keep_focus) ->
    sumatra_cmd = atom.config.get("latextools.win32.sumatra")
    sumatra_args = ["-reuse-instance"]

    if forward_sync
      sumatra_args = sumatra_args.concat(["-forward-search", '\"'+texfile+'\"', "#{row}"])

    sumatra_args.push('\"'+pdffile+'\"')

    command = sumatra_cmd + ' ' + sumatra_args.join(' ')
    @ltConsole.addContent("Executing " + command, br = true)

    exec command, {}, (err, stdout, stderr) =>
      if err > 1 # weirdness
        @ltConsole.addContent("ERROR #{err.code}: ", br=true)
        @ltConsole.addContent(line, br=true) for line in stderr.split('\n')




  _jumpDarwin: (texfile, pdffile, row, col, forward_sync, keep_focus) ->

    if keep_focus
      skim_args = "-r -g"
    else
      skim_args = "-r"

    if forward_sync
      skim_cmd = '/Applications/Skim.app/Contents/SharedSupport/displayline'
      command = skim_cmd + " #{skim_args} #{row} \"#{pdffile}\" \"#{texfile}\""
    else
      displayfile_cmd = path.join(atom.packages.resolvePackagePath("latextools"), "lib/support/displayfile")
      command = "sh " + displayfile_cmd + " #{skim_args} #{pdffile}"

    @ltConsole.addContent("Executing " + command, br=true)

    exec command, {}, (err, stdout, stderr) =><commit_msg>fixed missing "view" errors under windows<commit_after>{LTool,get_tex_root} = require './ltutils'
{exec, execFile} = require 'child_process'
path = require 'path'

module.exports =

class Viewer extends LTool


  _jumpWindows: (texfile, pdffile, row, col, forward_sync, keep_focus) ->
    sumatra_cmd = atom.config.get("latextools.win32.sumatra")
    sumatra_args = ["-reuse-instance"]

    if forward_sync
      sumatra_args = sumatra_args.concat(["-forward-search", '\"'+texfile+'\"', "#{row}"])

    sumatra_args.push('\"'+pdffile+'\"')

    command = sumatra_cmd + ' ' + sumatra_args.join(' ')
    @ltConsole.addContent("Executing " + command, br = true)

    exec command, {}, (err, stdout, stderr) =>
      if err # weirdness
        @ltConsole.addContent("ERROR #{err.code}: ", br=true)
        @ltConsole.addContent(line, br=true) for line in stderr.split('\n')




  _jumpDarwin: (texfile, pdffile, row, col, forward_sync, keep_focus) ->

    if keep_focus
      skim_args = "-r -g"
    else
      skim_args = "-r"

    if forward_sync
      skim_cmd = '/Applications/Skim.app/Contents/SharedSupport/displayline'
      command = skim_cmd + " #{skim_args} #{row} \"#{pdffile}\" \"#{texfile}\""
    else
      displayfile_cmd = path.join(atom.packages.resolvePackagePath("latextools"), "lib/support/displayfile")
      command = "sh " + displayfile_cmd + " #{skim_args} #{pdffile}"

    @ltConsole.addContent("Executing " + command, br=true)

    exec command, {}, (err, stdout, stderr) =>
{'fraction_non_alphanumeric': 0.16408355795148247, 'fraction_numerical': 0.0016846361185983828, 'mean_word_length': 3.6246105919003115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '719241', 'n_tokens_mistral': 1043, 'n_tokens_neox': 1013, 'n_words': 204}