<commit_before><script>
import Service from '../services/repo_service';
import Helper from '../helpers/repo_helper';
import Store from '../stores/repo_store';
import RepoPreviousDirectory from './repo_prev_directory.vue';
import RepoFileOptions from './repo_file_options.vue';
import RepoFile from './repo_file.vue';
import RepoLoadingFile from './repo_loading_file.vue';
import RepoMixin from '../mixins/repo_mixin';

export default {
  mixins: [RepoMixin],
  components: {
    'repo-file-options': RepoFileOptions,
    'repo-previous-directory': RepoPreviousDirectory,
    'repo-file': RepoFile,
    'repo-loading-file': RepoLoadingFile,
  },

  created() {
    window.addEventListener('popstate', this.checkHistory);
  },
  destroyed() {
    window.removeEventListener('popstate', this.checkHistory);
  },

  data: () => Store,

  methods: {
    checkHistory() {
      let selectedFile = this.files.find(file => location.pathname.indexOf(file.url) > -1);
      if (!selectedFile) {
        // Maybe it is not in the current tree but in the opened tabs
        selectedFile = Store.openedFiles.find(file => location.pathname.indexOf(file.url) > -1);
      }
      if (selectedFile) {
        if (selectedFile.url !== this.activeFile.url) {
          this.fileClicked(selectedFile);
        }

        if (location.hash.indexOf('#L') > -1) {
          const lineNumber = Number(location.hash.substr(2));
          if (!isNaN(lineNumber)) {
            Store.setActiveLine(lineNumber);
            if (Store.isPreviewView()) {
              document.getElementById(`L${lineNumber}`).scrollIntoView();
            } else {
              Helper.monacoInstance.setPosition({<commit_msg>Added Check for Line Number Element<commit_after><script>
import Service from '../services/repo_service';
import Helper from '../helpers/repo_helper';
import Store from '../stores/repo_store';
import RepoPreviousDirectory from './repo_prev_directory.vue';
import RepoFileOptions from './repo_file_options.vue';
import RepoFile from './repo_file.vue';
import RepoLoadingFile from './repo_loading_file.vue';
import RepoMixin from '../mixins/repo_mixin';

export default {
  mixins: [RepoMixin],
  components: {
    'repo-file-options': RepoFileOptions,
    'repo-previous-directory': RepoPreviousDirectory,
    'repo-file': RepoFile,
    'repo-loading-file': RepoLoadingFile,
  },

  created() {
    window.addEventListener('popstate', this.checkHistory);
  },
  destroyed() {
    window.removeEventListener('popstate', this.checkHistory);
  },

  data: () => Store,

  methods: {
    checkHistory() {
      let selectedFile = this.files.find(file => location.pathname.indexOf(file.url) > -1);
      if (!selectedFile) {
        // Maybe it is not in the current tree but in the opened tabs
        selectedFile = Store.openedFiles.find(file => location.pathname.indexOf(file.url) > -1);
      }
      if (selectedFile) {
        if (selectedFile.url !== this.activeFile.url) {
          this.fileClicked(selectedFile);
        }

        if (location.hash.indexOf('#L') > -1) {
          const lineNumber = Number(location.hash.substr(2));
          if (!isNaN(lineNumber)) {
            Store.setActiveLine(lineNumber);
            if (Store.isPreviewView()) {
              if (document.getElementById(`L${lineNumber}`)) document.getElementById(`L${lineNumber}`).scrollIntoView();
            } else {
              Helper.monacoInstance.setPosition({
{'fraction_non_alphanumeric': 0.13915574963609897, 'fraction_numerical': 0.0023289665211062593, 'mean_word_length': 3.1749696233292832, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '252249', 'n_tokens_mistral': 1000, 'n_tokens_neox': 994, 'n_words': 206}