apcshields / autocomplete-bibtex

Adds Pandoc-style BibTeX citation key autocompletion to autocomplete+ for Atom.
MIT License
44 stars 17 forks source link

Feature request: Allow longer titles before trimming #115

Open duderinoinpalatino opened 4 years ago

duderinoinpalatino commented 4 years ago

The reference-tools.js file contains the following lines of code:

function prettifyTitle(title) {
  let colon
  if (!title) {
    return
  }
  if (((colon = title.indexOf(':')) !== -1) && (title.split(" ").length > 5)) {
    title = title.substring(0, colon)
  }

      // make title into titlecaps, trim length to 30 chars(ish) and add elipsis
  title = titleCaps(title)
  const l = title.length > 30 ? 30 : title.length
  title = title.slice(0, l)
  const n = title.lastIndexOf(" ")
  return title.slice(0, n) + "...!"
}

Could the number of characters at which the title is trimmed (-ish) be added as an option to the package? Because otherwise, if I try to make the suggestions list wider by e.g. adding the following to my styles.less file,

autocomplete-suggestion-list {
  .word-container {
      width: 500px !important;
      max-width: 500px !important;
  }
  .word {
    max-width: 500px !important;
  }
}

it just trims the word and leaves a lot of unused space between its ellipsis and the right-label. Thank you!

screenshot