File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,25 @@ def _add_section_name(query):
2626 if '/' in query :
2727 return query
2828 if ' ' in query :
29- # for standalone queries only that may contain ' '
30- return "%s/%s" % tuple (query .split (' ' , 1 ))
31- return "%s/%s" % tuple (query .split ('+' , 1 ))
29+ delim = " "
30+ elif '+' in query :
31+ delim = "+"
32+
33+ index = 0
34+ length = len (query )
35+ while index != length :
36+
37+ index = query .index (delim , index ) + 1
38+
39+ try :
40+ comparison = query .index (delim , index )
41+ except ValueError :
42+ comparison = - 1
43+
44+ if (index != comparison and index != length ):
45+ return "%s/%s" % (query [:index - 1 ], query [index :])
46+
47+ return query
3248
3349def cheat_wrapper (query , request_options = None , output_format = 'ansi' ):
3450 """
Original file line number Diff line number Diff line change 33unchanged = """
44python/:list
55ls
6+ +
7+ g++
8+ g/+
9+ clang++
610btrfs~volume
711:intro
812:cht.sh
1418split = """
1519python copy file
1620python/copy file
21+
22+ g++ -O1
23+ g++/-O1
1724"""
1825
1926def test_header_split ():
You can’t perform that action at this time.
0 commit comments