.
This commit is contained in:
11
README.md
11
README.md
@ -65,6 +65,9 @@ fixing it would have been a lost cause, if not for Cscope itself. Well, Csope no
|
|||||||
+ saved kilobytes by stripping trailing whitespace
|
+ saved kilobytes by stripping trailing whitespace
|
||||||
+ FILE\* refsfound used to be rewind()-ed everytime the reads were not sequencial
|
+ FILE\* refsfound used to be rewind()-ed everytime the reads were not sequencial
|
||||||
|
|
||||||
|
# Control flow
|
||||||
|
...
|
||||||
|
|
||||||
# Project structure /*probably move to documentation*/
|
# Project structure /*probably move to documentation*/
|
||||||
| Component | Purpose |
|
| Component | Purpose |
|
||||||
| :-------: | :-----: |
|
| :-------: | :-----: |
|
||||||
@ -76,6 +79,12 @@ fixing it would have been a lost cause, if not for Cscope itself. Well, Csope no
|
|||||||
| readline.c | all functions directly dealing with GNU Readline; responsible for line editing in *input mode* |
|
| readline.c | all functions directly dealing with GNU Readline; responsible for line editing in *input mode* |
|
||||||
| help.c | all functions dealing with help messages |
|
| help.c | all functions dealing with help messages |
|
||||||
|
|
||||||
|
# Key Symbols
|
||||||
|
| Global | Role |
|
||||||
|
| :----: | :--: |
|
||||||
|
| int input_mode | Responsible of keeping track how current input should be handled. Not only does the readline handler depend on it, its also used to determine what types of inputs all legal (e.g. swapping to another window). Takes up on of the values of the INPUT_\* macros.
|
||||||
|
| int window_change | Bit mask type of the CH_\* macros. Keeps track of the windows to be refresed on the next run of display(). Could be better utalized.
|
||||||
|
|
||||||
# TODO /*move soon*/
|
# TODO /*move soon*/
|
||||||
+ sort out constants.h
|
+ sort out constants.h
|
||||||
+ scrollbar() uses magic int literals?
|
+ scrollbar() uses magic int literals?
|
||||||
@ -85,6 +94,7 @@ fixing it would have been a lost cause, if not for Cscope itself. Well, Csope no
|
|||||||
+ sort out the global hell
|
+ sort out the global hell
|
||||||
+ was there really ever a scrollbar?
|
+ was there really ever a scrollbar?
|
||||||
+ handle resizing
|
+ handle resizing
|
||||||
|
+ a search struct could be great for caching and could easy the global situation
|
||||||
## Original
|
## Original
|
||||||
+ Same capabilities as interactive in non interactive (one shot) mode
|
+ Same capabilities as interactive in non interactive (one shot) mode
|
||||||
+ Provide some how-do-I-use-this-thing doc.
|
+ Provide some how-do-I-use-this-thing doc.
|
||||||
@ -95,6 +105,7 @@ fixing it would have been a lost cause, if not for Cscope itself. Well, Csope no
|
|||||||
free(): double free detected in tcache 2
|
free(): double free detected in tcache 2
|
||||||
Aborted
|
Aborted
|
||||||
+ Changing text can crash without replacing text and leaving the console ncursed
|
+ Changing text can crash without replacing text and leaving the console ncursed
|
||||||
|
+ After an attempted change malloc *can* cry and crash
|
||||||
|
|
||||||
# Future features / contributor wishlist
|
# Future features / contributor wishlist
|
||||||
+ providing support for other languages by integrating new lexers (e.g. ctag's)
|
+ providing support for other languages by integrating new lexers (e.g. ctag's)
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
||||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT falseT LIMITED TO,
|
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
|
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT falseT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION)
|
INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
@ -67,7 +67,6 @@ char newpat[PATLEN + 1]; /* new pattern */
|
|||||||
static void scrollbar(MOUSE *p);
|
static void scrollbar(MOUSE *p);
|
||||||
|
|
||||||
/* read references from a file */
|
/* read references from a file */
|
||||||
|
|
||||||
bool readrefs(char *filename) {
|
bool readrefs(char *filename) {
|
||||||
FILE *file;
|
FILE *file;
|
||||||
int c;
|
int c;
|
||||||
@ -148,7 +147,7 @@ void countrefs(void) {
|
|||||||
/* count the references found and find the length of the file,
|
/* count the references found and find the length of the file,
|
||||||
function, and line number display fields */
|
function, and line number display fields */
|
||||||
|
|
||||||
/* HBB falseTE 2012-04-07: it may look like we shouldn't assing tempstring here,
|
/* HBB NOTE 2012-04-07: it may look like we shouldn't assing tempstring here,
|
||||||
* since it's not used. But it has to be assigned just so the return value
|
* since it's not used. But it has to be assigned just so the return value
|
||||||
* of fscanf will actually reach 4. */
|
* of fscanf will actually reach 4. */
|
||||||
while(EOF != (i = fscanf(refsfound,
|
while(EOF != (i = fscanf(refsfound,
|
||||||
|
@ -600,6 +600,8 @@ static inline void display_cursor(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void horswp_field(void) {
|
void horswp_field(void) {
|
||||||
|
if(input_mode != INPUT_NORMAL){ return; }
|
||||||
|
|
||||||
if(current_window != &wresult) {
|
if(current_window != &wresult) {
|
||||||
if(totallines == 0) { return; }
|
if(totallines == 0) { return; }
|
||||||
if(current_window == &winput) {
|
if(current_window == &winput) {
|
||||||
@ -613,6 +615,7 @@ void horswp_field(void) {
|
|||||||
current_window = last_window;
|
current_window = last_window;
|
||||||
if(current_window == &winput) { window_change |= CH_INPUT; }
|
if(current_window == &winput) { window_change |= CH_INPUT; }
|
||||||
}
|
}
|
||||||
|
|
||||||
window_change |= CH_RESULT;
|
window_change |= CH_RESULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,6 +410,9 @@ int change_input(const int c) {
|
|||||||
break;
|
break;
|
||||||
case ctrl('D'):
|
case ctrl('D'):
|
||||||
changestring(input_line, newpat, change, totallines);
|
changestring(input_line, newpat, change, totallines);
|
||||||
|
input_mode = INPUT_NORMAL;
|
||||||
|
horswp_field();
|
||||||
|
search(newpat);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
@ -506,9 +509,7 @@ int changestring(const char *from, const char *to, const bool *const change,
|
|||||||
fflush(script);
|
fflush(script);
|
||||||
|
|
||||||
/* edit the files */
|
/* edit the files */
|
||||||
fprintf(stderr, "Changed lines:\n\r");
|
execute("sh", "sh", temp2, NULL); // XXX: this should not echo
|
||||||
execute("sh", "sh", temp2, NULL);
|
|
||||||
askforchar();
|
|
||||||
end:
|
end:
|
||||||
fclose(script);
|
fclose(script);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user