comparison src/tag.c @ 5328:c47c8cd5fe5c v7.4.017

updated for version 7.4.017 Problem: ":help !!" does not find the "!!" tag in the help file. (Ben Fritz) Solution: When reading the start of the tags file do parse lines that are not header lines.
author Bram Moolenaar <bram@vim.org>
date Thu, 05 Sep 2013 12:06:33 +0200
parents 1707ddb6f5ae
children 6ae816249627
comparison
equal deleted inserted replaced
5327:d17ef148ada4 5328:c47c8cd5fe5c
1795 * When still at the start of the file, check for Emacs tags file 1795 * When still at the start of the file, check for Emacs tags file
1796 * format, and for "not sorted" flag. 1796 * format, and for "not sorted" flag.
1797 */ 1797 */
1798 if (state == TS_START) 1798 if (state == TS_START)
1799 { 1799 {
1800 /* The header ends when the line sorts below "!_TAG_". 1800 /* The header ends when the line sorts below "!_TAG_". When
1801 * There may be non-header items before the header though, 1801 * case is folded lower case letters sort before "_". */
1802 * e.g. "!" itself. When case is folded lower case letters
1803 * sort before "_". */
1804 if (STRNCMP(lbuf, "!_TAG_", 6) <= 0 1802 if (STRNCMP(lbuf, "!_TAG_", 6) <= 0
1805 || (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1]))) 1803 || (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1])))
1806 { 1804 {
1805 if (STRNCMP(lbuf, "!_TAG_", 6) != 0)
1806 /* Non-header item before the header, e.g. "!" itself.
1807 */
1808 goto parse_line;
1809
1807 /* 1810 /*
1808 * Read header line. 1811 * Read header line.
1809 */ 1812 */
1810 #ifdef FEAT_TAG_BINS 1813 #ifdef FEAT_TAG_BINS
1811 if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0) 1814 if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0)
1896 continue; 1899 continue;
1897 } 1900 }
1898 #endif 1901 #endif
1899 } 1902 }
1900 1903
1904 parse_line:
1901 /* 1905 /*
1902 * Figure out where the different strings are in this line. 1906 * Figure out where the different strings are in this line.
1903 * For "normal" tags: Do a quick check if the tag matches. 1907 * For "normal" tags: Do a quick check if the tag matches.
1904 * This speeds up tag searching a lot! 1908 * This speeds up tag searching a lot!
1905 */ 1909 */