@@ -1921,6 +1921,32 @@ find_tags(
19211921 }
19221922
19231923parse_line :
1924+ if (vim_strchr (lbuf , NL ) == NULL
1925+ #ifdef FEAT_CSCOPE
1926+ & & !use_cscope
1927+ #endif
1928+ )
1929+ {
1930+ // Truncated line, ignore it. Has been reported for
1931+ // Mozilla JS with extremely long names.
1932+ if (p_verbose >= 5 )
1933+ {
1934+ verbose_enter ();
1935+ msg (_ ("Ignoring long line in tags file" ));
1936+ verbose_leave ();
1937+ }
1938+ #ifdef FEAT_TAG_BINS
1939+ if (state != TS_LINEAR )
1940+ {
1941+ // Avoid getting stuck.
1942+ linear = TRUE;
1943+ state = TS_LINEAR ;
1944+ vim_fseek (fp , search_info .low_offset , SEEK_SET );
1945+ }
1946+ #endif
1947+ continue ;
1948+ }
1949+
19241950 /*
19251951 * Figure out where the different strings are in this line.
19261952 * For "normal" tags: Do a quick check if the tag matches.
@@ -1937,28 +1963,6 @@ find_tags(
19371963 tagp .tagname_end = vim_strchr (lbuf , TAB );
19381964 if (tagp .tagname_end == NULL )
19391965 {
1940- if (vim_strchr (lbuf , NL ) == NULL )
1941- {
1942- /* Truncated line, ignore it. Has been reported for
1943- * Mozilla JS with extremely long names. */
1944- if (p_verbose >= 5 )
1945- {
1946- verbose_enter ();
1947- msg (_ ("Ignoring long line in tags file" ));
1948- verbose_leave ();
1949- }
1950- #ifdef FEAT_TAG_BINS
1951- if (state != TS_LINEAR )
1952- {
1953- /* Avoid getting stuck. */
1954- linear = TRUE;
1955- state = TS_LINEAR ;
1956- vim_fseek (fp , search_info .low_offset , SEEK_SET );
1957- }
1958- #endif
1959- continue ;
1960- }
1961-
19621966 /* Corrupted tag line. */
19631967 line_error = TRUE;
19641968 break ;
0 commit comments