<commit_before>path = null
PdfEditorView = null

module.exports =
  activate: (state) ->
    @opener = atom.workspace.addOpener openUri
    atom.packages.onDidActivateInitialPackages -> createPdfStatusView()

  deactivate: ->
    @opener.dispose()
  
  config:
    enableSyncTeX:
      type: "boolean"
      default: true
      title: "Enable SyncTeX"
      description: "A click on a PDF generated by `pdftex` with the ``--synctex=1` option will take you to the source."
    syncTeXPath:
      type: "string"
      default: ""
      title: "Path to `synctex` binary"
      description: "If not specified, look for `synctex` in `PATH`"

# Files with these extensions will be opened as PDFs
pdfExtensions = ['.pdf']
openUri = (uriToOpen) ->
  path ?= require 'path'
  uriExtension = path.extname(uriToOpen).toLowerCase()
  if uriExtension in pdfExtensions
    PdfEditorView ?= require './pdf-editor-view'
    new PdfEditorView(uriToOpen)

createPdfStatusView = ->
  PdfStatusBarView = require './pdf-status-bar-view'
  new PdfStatusBarView()
  PdfGoToPageView = require './pdf-goto-page-view.coffee'
  new PdfGoToPageView()

PdfEditorDeserializer =
  name: 'PdfEditorDeserializer'
  deserialize: ({filePath}) ->
    if require('fs-plus').isFileSync(filePath)
      PdfEditorView ?= require './pdf-editor-view'
      new PdfEditorView(filePath)
    else
      console.warn "Could not deserialize PDF editor for path '#{filePath}' because that file no longer exists"
atom.deserializers.add PdfEditorDeserializer
<commit_msg>:art: :hammer: config settings text<commit_after>path = null
PdfEditorView = null

module.exports =
  activate: (state) ->
    @opener = atom.workspace.addOpener openUri
    atom.packages.onDidActivateInitialPackages -> createPdfStatusView()

  deactivate: ->
    @opener.dispose()

  config:
    enableSyncTeX:
      type: "boolean"
      default: true
      title: "Enable SyncTeX"
      description: "A click on a PDF generated with the `--synctex=1` option will take you to the source."
    syncTeXPath:
      type: "string"
      default: ""
      title: "Path to synctex binary"
      description: "If not specified, look for `synctex` in `PATH`"

# Files with these extensions will be opened as PDFs
pdfExtensions = ['.pdf']
openUri = (uriToOpen) ->
  path ?= require 'path'
  uriExtension = path.extname(uriToOpen).toLowerCase()
  if uriExtension in pdfExtensions
    PdfEditorView ?= require './pdf-editor-view'
    new PdfEditorView(uriToOpen)

createPdfStatusView = ->
  PdfStatusBarView = require './pdf-status-bar-view'
  new PdfStatusBarView()
  PdfGoToPageView = require './pdf-goto-page-view.coffee'
  new PdfGoToPageView()

PdfEditorDeserializer =
  name: 'PdfEditorDeserializer'
  deserialize: ({filePath}) ->
    if require('fs-plus').isFileSync(filePath)
      PdfEditorView ?= require './pdf-editor-view'
      new PdfEditorView(filePath)
    else
      console.warn "Could not deserialize PDF editor for path '#{filePath}' because that file no longer exists"
atom.deserializers.add PdfEditorDeserializer

{'fraction_non_alphanumeric': 0.10863144076140466, 'fraction_numerical': 0.0006563833278634722, 'mean_word_length': 3.667687595712098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7281166', 'n_tokens_mistral': 975, 'n_tokens_neox': 966, 'n_words': 258}